What kind of database are you using (Access/Sql Server/DB2) ? The correct way of using the BETWEEN clause is:
SELECT column_name(s) FROM table_name WHERE column_name BETWEEN value1 AND value2 Regards, Benj On Jul 28, 4:32 pm, Jeena Ajiesh <[email protected]> wrote: > *Dear friends,* > ** > *im stucked in a problem.* > *in database im having fromdate,todate, message and id* > *fromdate & todate contains dates with time.* > ** > *Eg in DB:Fromdate > Todate Message Id * > * 7/25/2010 10:00:00 AM 8/1/2010 12:00:00 PM > Test abc* > * 7/25/2010 9:00:00 PM 8/1/2010 10:00:00 PM > Hello abc* > ** > *Im passing a date 7/29/2010 9:15:00 PM.So i need to get the message from > table as 'Hello'* > ** > *i tried a query SELECT MESSAGE FROM TABLENAME WHERE '7/29/2010 9:15:00 PM > BETWEEN FROMDATE AND TODATE* > *Can u please help in giving a correct query to retrieve the correct message > in DB based on the datetime passing.* > ** > ** > **************** > **Thanks & Regards, > Jeena Ajiesh > *
