If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Search for records having the date and after

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-08-06, 22:00
Cuttie0506 Cuttie0506 is offline
Registered User
 
Join Date: Jan 2006
Posts: 44
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
Reply With Quote
  #2 (permalink)  
Old 02-15-06, 22:56
Jelly Link Jelly Link is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On