Wednesday, December 28, 2005

Setting a SELECTs where Clause to Include Current Date/Time

You can use SYSDATE in the WHERE clause of a SELECT statement to only get certain fields. For example, if I only want entries from the last day, and the DATE/TIME column is DATADATETIME:

SELECT * FROM MYTABLE DATADATETIME < (SYSDATE) AND DATADATETIME > ((SYSDATE)-1)

No comments:

Labels

Blog Archive

Contributors