Forum Replies Created

Viewing 15 posts - 31 through 45 (of 58 total)

  • Reply To: Calculating Intervals

    Well, CREATE VIEW is nice and can beusefull, but only after CREATE TABLE datMeterReading, EligibleActivityPerformed, mapEquipmentLocation

    Once we wee how tables look like, then we can comment on the views you...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: simple cardinality question

    Try not to look at the problem formally, mechanically. Describe what is happening in aa few sentences then look at them. This is how:

    1. I am tracking users and...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Calculating Intervals

    Hard to tell anything. How about some CREATE TABLE statement, some tets data and explanation of the proble. How can we check the view if we do not know tables?

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Query Tuning, Why Bother?

    m60freeman wrote:

    "In every job I've had as a SQL DBA, I was the company's first DBA, and the main reason they hired me is that they realized that the C#...

    • This reply was modified 3 years, 10 months ago by Zidar.
    • This reply was modified 3 years, 10 months ago by Zidar.

    Zidar's Theorem: The best code is no code at all...

  • Reply To: How to Find the Start and End Dates for the Current Week (and more)

    Truly brilliant.

    By trial and error I was able to add absolute week number to my version of Calendar Table. Detailed explanation beats trial and error on any day.

    Again, brilliant. Any...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: SSIS Random Failure reading from Excel

    Could it be Microsoft itself? Data transfer between Excel and anything else, including MS SQL server, is a game of chance. It may work, it may not, randomly. Kind of...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: A Culture That Allows Mistakes

    No matter how hard we try, there will be mistakes and issues. true, most mistakes can be traced to a person. Passing blame to the person at that moment changes...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: explicite alternative to FORMAT() concerning DATE

    Q: Sorry, but I'm not seeing it.  How would such a thing be used to improve the performance of the query the OP posted?

    Valid point, chances are good it does...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: explicite alternative to FORMAT() concerning DATE

    Since Tally Table of dates was mentioned, here is how to construct it:

    1. create fnTally - table of numbers, by Jeff Moden, here  https://www.sqlservercentral.com/scripts/create-a-tally-function-fntally
    2. use the function to generate...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Problem understanding SUM function with GROUP BY

    If you provide CREATE TABLE and some sample data, and tell us what is that you expect to see, perhaps more help could be provided. There are many reasons why...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Barcode Scan Into SQL Server

    barcode scanner is a simple data entry device. It scans over barcode lines (bars, hence bar-code) and translate bars to text. Some by default add <carriage return> character at the...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: Who's Smarter? Humans or AI Systems?

    When something sounds mystic, people tend to believe in it. If we look around, on this continent, it is not Artificial Intelligence that is missing. It is NA, natural intelligence...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: How show only first friday of every month

    OK, here are more columns;

    -- Add more columns:

    -- Add more columns:
    ALTER TABLE #Calendar
    ADD Day_in_Year int-- 1,2,3...364,365 (366)

    ALTER TABLE #Calendar
    ADD DayOccuranceInMonth int -- 1,2,3,4...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: How show only first friday of every month

    How to determine each 1st Friday in given time interval, using a permanent Calendar table.

    A table must be created and populated with data in order to be permanent. I will...

    Zidar's Theorem: The best code is no code at all...

  • Reply To: How show only first friday of every month

    @jeff (#3932950)

    Thank you for welcoming words. Thank you for very thorough reading of the post, means a lot to me. 🙂

    I agree with all observations about oddities in the code....

    Zidar's Theorem: The best code is no code at all...

Viewing 15 posts - 31 through 45 (of 58 total)