Tag: syndicated

  • Getting a Day Difference in PowerShell–#SQLNewBlogger

    Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

    SSMS froze on me the other day. Actually, it lightly responded to some things, but the window wouldn’t redraw and I couldn’t see the query window. I could see the results pane, but couldn’t get the app to respond.

    I wanted to get the difference between two dates, and wasn’t sure, so I quickly searched. I tried assigning the date to a variable, but this creates a string:

    $start = “2020-03-11”

    With a couple searches, I learned I can use Get-Date to get a date variable. In this case, I’d do this:

    $start = Get-Date -Date "2020-03-11"

    If I did that with two dates, I could get the difference. Here’s a screen show that shows I get the result in a variety of different time slices.

    2022-02-15 10_22_09-E__..._git_fwddemo

    If I wanted just days, I could do this:

    ($end - $start).Days

    That returns just the 712.

    I also learned I could shortcut this with a TimeSpan type.

    New-TimeSpan -Start “2020-03-11” -End (Get-Date)

    I get the same spread of time parts as the image above, or I can enclose this all in parenthesis and then call the “Days” property to get that value.

    SQL NewBlogger

    I hadn’t done much with date and time in PoSh, and after seeing an article from an author, I investigated a bit more. This was a part of what I tried to do, albeit as a response to something not working as expected.

    Good to know how to work with dates, as I can see this being a part of many PoSh scripts that might clean up old files or otherwise take action based on time values.

    You could write this post in about 10-15 minutes and show how you use PoSh to work with date and times.

  • Daily Coping 21 Feb 2022

    I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag.

    Today’s tip is to look back at the pandemic; what are the strangest memories you have?

    I wrote this tip because I ran across some old pictures from the last two years. Here are a few things that struck me as strange.

    I found myself doing yoga on the front lawn because the gym was closed.

    20200519_130614_HDR (1)

    I had really taken it for granted that I could go to the gym every week. Maybe not every day, but I’d get there and be able to take a class or use weights. While I could do yoga alone, and I had some videos out in the yard, I was surprised that a) I didn’t have other options, and b) it worked out pretty well. I enjoyed being out there in the spring and am looking forward to it periodically this year.

    I’ve traveled a lot for years, and I’ve seen plenty of people in masks in airports and on planes, albeit a minority. I still can’t believe that we got so many people to wear masks, we had regulations, and I coached in one with kids playing sports in one.

    20201121_164505

    I’ve enjoyed some online gatherings, but I can’t believe that I was a part of multiple online classes for cooking or cocktail making. If you had asked me my interest level in 2019 for this, I would have said zero. The last two years I’ve looked forward to a few.

    Exav7IGVgAA9oRI orig

    I’ve lived in America for most of my life. This is the land of plenty, and often, excess. I’ve lived in places with hurricanes and blizzards, and seen shops quite empty at times because the demand far exceeds the supply, at least for some items.

    I was surprised to see so many empty shelves, especially a lack of toilet paper, early in the pandemic. A very strange time for me.

    20200314_163948(1)

    In line with that, I remember coming out of volleyball practice one night and going to the store to get things for the next day, only to find it closed. All stores were closed around 8 or 9pm. Quite an experience for me.

    Perhaps one really strange thing for me was a lot of time with horses. Not just around them, as that’s normal, but on them. I never look to ride very often, but I will if my wife asks. We plan some trips, but around the house I’m usually busy or traveling myself.

    In 2020, I ended up taking more rides with my wife around our property and the local area because there wasn’t much else to do. No distractions, nothing open, no work trips, so I spent a lot of time on horseback.

    Well, not a lot, but a lot for me.

    20200814_153603

    Overall the pandemic was not that hard for me. In some ways, it was enjoyable as life slowed down, more time with family, I had all my kids some again for a period of time, and I used all my vacation.

    Maybe that was the best part. Usually work gets in the way of too many personal trips, but in I managed to get out, camp and travel a bit, using up all my vacation with family.

  • Daily Coping 18 Feb 2022

    I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag.

    Today’s tip is to support a local business with a positive review or friendly message.

    I like supporting local people, and try to do it regularly. Recently we were on vacation in the Colorado mountains, in a place we go often. There are a few restaurants that we visit often, like the Dam Brewery or Dos Locos.

    This time, as we were driving around, I saw a new place, the Eclectic Bar and Grill. I pulled in, thinking to just try a new place.

    It was fantastic, and quiet on a late afternoon. We ended up talking with the manager and praising the menu and food, which was great. I also took time to drop a review on Google. Hopefully they get popular enough to stay in business.

  • SQL Saturday Colorado Springs 2022

    In just over a month, SQL Saturday comes back to Colorado Springs. On Mar 19, SQL Saturday Colorado Springs 2022 is taking place at the local library. This is a chance ot meet in person and see other data platform professionals in the local area.

    If you are in the Denver/Colorado Springs area, please pass the word. Data Professionals, Developers, everyone is welcome that wants to come out to a live event. It’s a one track event, which I find to be a fun type of conference. Everyone sees the same thing, and we have a collective experience.

    I won’t be there, sadly, as I have previous plans to visit my daughter in NY. I’m sad to miss the event, but I hope a lot of you make plans to go and enjoy the chance to get together.