Re: SELECT * FROM WHATEVER WHERE DATETIME(invc_date) YEAR TO DAY = ??
Posted in 1994
How about select * from whatever where month(invc_date) = variable_month Good luck -- Con Woodall Colorado St. U.; Veterinary Teach. Hosp.; cwoodall@vth1.vth.colostate.edu On 28 Nov 1994, Paul Fabozzi wrote: } I would like to do a select on a date field which will include all } records for a certain month. So I define a DATETIME YEAR TO MONTH } Variable, and I want to compare this to a date field in my table. } } I cant figure the syntax, I tried } } SELECT * FROM invc_header WHERE (DATETIME (invoice_date) YEAR TO MONTH) = } "1994-11" } } The "1994-11" should be able to be a variable (DATETIME YEAR TO MONTH) } } But it gives me syntax errors. } Has anybody had any success with this type of select. } Paul Fabozzi } ---------------------------------- } Staten Island MicroAge } ---------------------------------- }