I would like this query to be able to automagically know today’s date & time as well as the first of the year (or month) (or week)…
SELECT TicketID
FROM Ticket
WHERE (Ticket.DtCheckOut > '1/1/2011 12:00:00 AM')
AND (Ticket.DtCheckOut < '8/27/2011 12:00:00 AM')
I know it will use GETDATE() in some form, but you don’t want to see what I’ve come up with, I promise!
Here is what I was reading on GETDATE() MDSN: GETDATE(Transact-SQL)
I looked around here and Google – and didn’t find anything ‘clean’ – so any input would be awesome!
@@DATEFIRSTis SQL Server’s first day of the week, which defaults to Sunday if you are using U.S. English.