Quote:
Originally posted by M Owen
Since you're seeking a match to an exact date why use the "floor" function? Just do : WHERE ( MyTableName.TradeDate=#Date Literal Here#);
Or if it's inexact the date (i.e. the lastmost time ) do something like:
SELECT TOP 1 Fieldsgohere ... FROM MyTable WHERE (MyTable.Table_Date=#Date Literal Here#) ORDER BY Table_Date DESC;
|
M Owen,
Thanks for your reply.
Actually I need to retrieve all the data that has the same day of the desired data doesn't matter hour,minutes,seconds.
For example the desired date is 11/05/2003 so I want that records with dates like 11/05/2003 18:53:30, 11/05/2003 01:34:12, ...etc all come in my query.
I know one approach could be ... WHERE MyTableName.TradeDate>=#Date Literal Here# AND
MyTableName.TradeDate<#Date Literal Here# + 1
but I also have more complex queries that joins this table with dates like "mm/dd/yy hh:mm:ss" with another table than has just "mm/dd/yy" and in this case I'd do something like
... table1 INNER JOIN table2 WHERE table2.Table_Date = floor(table1.Table_Date)
That is why the floor() function would help me a lot
Rgds,
PC2