Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2006
    Posts
    44

    Unanswered: Search for records having the date and after

    I request the date from my textbox "txtStart".
    The date format is "12-Feb-2006"

    I want to search records that have the date "12-Feb-2006" or after that date. How do i search for that?

    Btw, the date inside my db is a text.

    Code:
    	If request.form ("txtStart") <> "" Then
    		strSentence9 = request.form("txtStart")
    	End If
    Code:
    		sqlString = "Status LIKE ('"& strSentence1 &"%') AND Recipient LIKE ('"& strSentence2 &"%') AND Action_Taken LIKE ('"& strSentence3 &"%') AND Severity LIKE ('"& strSentence4 &"%') AND Week LIKE ('"& strSentence5 &"%') AND Class LIKE ('"& strSentence6 &"%') AND Business_Unit LIKE ('%"& strSentence7 &"%') AND Server_Name LIKE ('%"& strSentence8 &"%') AND DeadLine LIKE ('%"& strSentence9 &"%')"
    Thanx

  2. #2
    Join Date
    Dec 2003
    Posts
    39

    convert to datetime type

    deadlineSqlString = "datediff(day,cast('" & strSentence9 & "' as smalldatetime),cast(DeadLine as smalldatetime))>=0"

    note : the date must be with the right date format
    Link Link

Posting Permissions

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