Yes, you could do something like that, though you could also just use the t_stamp column. Irregardless of what columns you’re retrieving, you can use any available columns in your where clause.
Why would you choose one over the other? Basically the answer comes down to performance. The t_stamp column is indexed, meaning the db can (theoretically) locate a particular value in less time than it would take to look through the whole table. If you used ‘dt’ in your where clause, the db would first need to calculate what that means for each row, and then narrow it down to what you wanted. By using timestamp, it can quickly just grab the matching rows, and then only calculate dt for those.
Ultimately in your case I’d doubt you’d notice the difference, so I’d go with what’s most readable… but I just wanted to give you some info that might come in handy later.
Oh, and yeah, your WHERE clause looks good, as long as ‘StartDate’ and ‘EndDate’ are properly formatted dates.
Regards,