Jeff C

Jeff C

  • NA
  • 9
  • 0

Fetch records from sql on basis of datetime.

Jun 5 2010 12:48 AM

Hello,
I am attempting to do a query with the following:
I have a table called callstats, it has 2 columns I'm interested in: OfferTime & AnswerTime.  The data contained in them is in the format  dd/mm/yyyy hh:mm:ss 
Offertime always has a data in it, but sometimes AnswerTime can be empty.
The table itself has a year's worth of data.
I want a query that will give me whatever month's worth I query, I've tried several variations of the following to get a month's worth and nothing
"SELECT OfferTime, AnswerTime FROM callstats WHERE OfferTime LIKE '%Jan%' AND AnswerTime LIKE '%'"
This isn't returning any results.  Basically I'm interested in entries for both columns, I want it to check the first column, if it's Jan, then read it and the 2nd column regardless if it's got data in it or not.
 
Thanks in advance.

Answers (5)