Text to Date format

Results 1 to 2 of 2

Thread: Text to Date format

  1. #1
    Join Date
    Dec 1969

    Default Text to Date format

    Hi all<BR><BR>How do I change text to a date format in ASP. <BR>For example...<BR><BR>SearchText = Request.Form("txtSearchText")<BR><BR>SQL = "SELECT Sale.* "<BR>SQL = SQL & "FROM Sale "<BR>SQL = SQL & "WHERE Date &#062; " & SearchText<BR><BR>I can use LIKE in SQL and it works. But I want to use &#062; or =, and it doesnt work because the SearchText is in text format. So how do I change it to date format?<BR><BR>Thanks :)

  2. #2
    Join Date
    Dec 1969

    Default RE: Text to Date format

    You should use casting, i.e. CDate(text). For an example:<BR>http://www.devguru.com/Technologies/vbscript/quickref/cdate.html<BR><BR>Just make sure the text is in correct format...

Posting Permissions

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