I would like to fetch data for records for a given date/ 1 day interval.
This means from
23:59:59 of that day. The date value comes from another table in a join statement... i.e, it's not a parameter.
Suppose I have a
Transactions table with a
From my research, I have two possible options(amongst others).
Calculate the datetime range values for that day
DateAdd(dd, 1, DateAdd(ss, -1, CONVERT(DATE,Transaction.DateOccured))) -- 1 second before midnight of following day
(several options of doing this, e.g placing this in the
SELECT list or placing it in the
Datetimeto date then append appropriate strings(for the time portion) to create the range (does not seem efficient)
Which would be the best strategy?
Would I place this calculation in the
SELECT list and use as a field in the
WHERE? or is it better of in the