Viewing 15 posts - 1 through 15 (of 106 total)
@scdecade, yes, the statement does access the ctes. I've edited my original post to include the entire query. Sorry, I should've done this at first.
August 15, 2019 at 6:22 pm
@scdecade, sorry for the difficulty. Here is the part of the query that is references the cte, which happens to be another cte:
,VESValidEnrollList AS( ...
August 15, 2019 at 5:41 pm
@scdecade, when I try the above that you provided, I'm still getting the same errors. Any other suggestions, please?
August 15, 2019 at 5:09 pm
@scdecade, thanks for your input. When I try GROUP BY 1,2,3,4,5 , it still returns the "Each GROUP BY expression must contain at least one column that is...
August 15, 2019 at 3:47 pm
Thanks for your input, ZZartin!
August 13, 2019 at 2:55 pm
Thank you, drew.allen! That worked perfectly. I added in a Min, at the beginning, as I need to take the earliest date, and fiddled with the placement of the parentheses...
August 13, 2019 at 2:13 pm
Thank you, Phil Parkin!
August 13, 2019 at 2:11 pm
Thank you, Phil. You're brilliant!
July 1, 2019 at 5:23 pm
Thanks, Phil! I agree that this, is indeed, a monstrosity. I feel like I've had to bend my brain to make sense of it. So a question about your response....
July 1, 2019 at 5:08 pm
Wow...thank you, everyone for all of your valuable feedback! It's very much appreciated! I meant to apologize for the rather lengthy query, but I was desperate to get some insight....
May 28, 2019 at 8:07 pm
I believe you could also use COALESCE:
SELECT (LEFT(COALESCE( middlename, ”) , 1) )
April 15, 2019 at 8:10 pm
Thanks, Jeff. I'll keep this valuable feedback in mind. Meanwhile, I think I've found the issue causing the null dates...it has to do with the date fields not being checked...
January 28, 2019 at 2:10 pm
Thanks for your comment. Please take a look at my edits.
January 17, 2019 at 2:40 pm
January 3, 2019 at 10:27 am
kn_murthy - Wednesday, January 2, 2019 11:58 AM
Have you tried casting the date fields as datetime or datetime2 ?
January 2, 2019 at 12:23 pm