Inserting the date into a database (ASP) Watch

This discussion is closed.
AT82
Badges: 0
Rep:
?
#1
Report Thread starter 16 years ago
#1
I am finishing of my website and writing the message board system for my articles section. The problem I have is how do you insert the date into the database?

I've tried cdate and date but it just comes back with error messages.

Code:
objrs("date") = what goes here?
objrs("time") = what goes here?
Everything else works fine its just this date problem, I need to have the date inserted so I can use an SQL statement to sort the replies by date and maybe time.

I've looked in my ASP book and it tells me nothing.

Thanks.
0
loftx
Badges: 0
Rep:
?
#2
Report 16 years ago
#2
Inserting the date into a database? I would do it with an sql query

Code:
StrQ = "INSERT INTO myTable (aDate, aTime) VALUES (#" & date() & "#, #" & time() & "#)"
objConnection.Execute strQ
That could be slightly wrong my SQL is a little rusty, but dates and times always have ## round them - that may be the problem.
0
X
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

People at uni: do initiations (like heavy drinking) put you off joining sports societies?

Yes (476)
66.57%
No (239)
33.43%

Watched Threads

View All