Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I pass today's date to an asp page?

Status
Not open for further replies.

ggrewe

IS-IT--Management
Jul 10, 2001
169
US
I have an asp page that allows user to query an Access database through a registration date. I want this page to default to the records that have been entered for today's date. I could not figure out how to get the default field to be today's date, so I forced it to a static date.

ANy ideas would be greatly appreciated.

s-sql="SELECT * FROM Convention WHERE (DateReg = #::DateReg::#)"
b-procedure="FALSE" clientside SuggestedExt="asp" s-DefaultFields="DateReg=11/21/2001"
 
today's date:

formatDateTime(now(),2)

Will return today's date with no time...

:)
Paul Prewett
penny.gif
penny.gif
 
You could also use


your_variable = date()




Have Fun...

Sharky99 >:):O>
 
So would the default code look like this?

s-DefaultFields="DateReg=formatDateTime(now(),2)"
 
Should be..
s-DefaultFields="DateReg=" & formatDateTime(now(),2) ------------------
Freedom is a Right
 
When I try this format;

s-DefaultFields="DateReg=" & formatDateTime(now(),2)

The page returns an error that basically states that I failed to pass a value for the field. It shows up in the query as Select * from convention where (DateReg = ##)
 
StartMyDate=date()
StopMyDate = DateAdd("D", +6, StartMyDate)

SELECT QryB1204.Date, QryB1204.[8h00], QryB1204.[22h30] FROM QryB1204 WHERE (((QryB1204.Date)>=#&quot; & StartMyDate & &quot;# And (QryB1204.Date)<=#&quot; & StopMyDate & &quot;#)) ORDER BY QryB1204.Date;&quot;

I get todays date and add 6 days to finally have 7 days starting from today...

THIS SHOULD WORK....

Have Fun...

Sharky99 >:):O>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top