SQL Statement - Date

Results 1 to 3 of 3

Thread: SQL Statement - Date

  1. #1
    Join Date
    Dec 1969

    Default SQL Statement - Date

    I have a SQL statement that works great for pulling fields that are after a certain date to the present date. Now I need to be able to query a specific day. I can&#039t seem to get it. I tried using a date range with dates listed like 11/12/2000, 12:00 AM, but when using vaiables for the above date format I get character errors when the statement was executed. So a bagged that idea. Is there a way to use a command like the "like&#039 command when using dates? My current SQL statement is below:<BR><BR>sql = "select ts_lastname,ts_departmentno,ts_location,ts_timein, ts_totaltime from stats where ts_timein &#062;= &#039" & calc_new & "&#039"<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL Statement - Date

    try it out<BR>convert(datatype,what to convert,which format)<BR>e.g.<BR>convert(varchar,getdate(),101)

  3. #3
    Join Date
    Dec 1969

    Default What kind of DB? See ASPFAQs, too.

    Remember, Access uses #...# around dates, not &#039...&#039<BR><BR>Anyway, I put an answer here a while back:<BR>http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=59

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts