Date question (again, sorry)

Results 1 to 2 of 2

Thread: Date question (again, sorry)

  1. #1
    Join Date
    Dec 1969

    Default Date question (again, sorry)

    I&#039;m using the code below to show my date in the right format.<BR><BR>But, as well as showing, I need to do a search by date... It doesn&#039;t work, because the below returns:<BR><BR>8/7/2004 <BR><BR>FormatUKDateTime = Day(dt) & "/" & Month(dt) & "/" & Year(dt) <BR><BR>And my query (which converts the date in SQL Server) uses 08/07/2004... annoying!<BR><BR>How can I do for FormatUKDateTime function return day and month with a zero on the left if necessary? eg: 08/07/2004 and not 8/7/2004?<BR><BR>My query is as below (WHERE bit only):<BR><BR>Srch_Stmnt = " WHERE Convert(varchar(20), Invoice_Date,103) LIKE &#039;%"& CustKeyword &"%&#039;" <BR><BR>Thank you so much!!!

  2. #2
    Join Date
    Dec 1969

    Default If you do the search in the WHERE...

    ...clause of your SQL statement, then you should put the date in ISO format, e.g. yyyy/mm/dd - or even yyyy/m/d will do.<BR><BR>SELECT ... WHERE MyDate = #2004/07/08#<BR><BR>Oliver.

Posting Permissions

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