|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hi,
I am trying to build a rescordset where I select only items with todays date and todays date + 1 ie SELECT * From database WHERE date = todays date I have not been able to find (what is probably very right in front of me) the term for this.. Any suggestions and also links to a command reference? Using Dreamweaver MX 2004, ASP and VBScript connecting to an MS Access Database Cheers Ken |
|
#2
|
||||
|
||||
|
Code:
SELECT * FROM TableName WHERE DateField = '" & Date() & "' OR DateField = '" & Date() + 1 & "' |
|
#3
|
||||
|
||||
|
Hi, Memnoch
I get a 'Data Type Mismatch in Criteria Expression' error the Date Field in Access is set to Date/Time and Format is Medium Time Does it have to be a specific format? You input is greatly Appreciated... Regards, Ken |
|
#4
|
||||
|
||||
|
For Access
Code:
SELECT * FROM TableName WHERE DateField = #" & Date() & "# OR DateField = #" & Date() + 1 & "#" |
|
#5
|
||||
|
||||
|
Hi,
This is how I finally got it working... SELECT *FROM [Your_Table] WHERE ((Your_Table.Date_Field)=Date()); SELECT *FROM [Your_Table] WHERE ((Your_Table.Date_Field)=Date()+1); Hope this helps others and thanks for your input.. Regards, Ken |
|
#6
|
|||
|
|||
|
select * from table where convert(char,datefield,101) = convert(char,getdate(),101)
|
|
#7
|
|||
|
|||
|
select * from table where convert(char,datefield,101) = convert(char,dateadd(day,1,getdate()),101)
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Todays Date in SQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|