Trying to insert a date into the access database and it's driving me barmy. I'm sure I've done this before.
variable:
SQL statement:
SQL output:
DB date output when redisplayed:
I've tried using #s and converting to 'string' but nothing seems to get around it. How can I get the date to register properly?
variable:
Code:
whatnow = day(date)&"\"&month(date)&"\"&year(date)
SQL statement:
Code:
sql=""
sql=sql&"INSERT INTO students (sname1, sname2, semail, smembership, spass, saddress, sdatereg) VALUES ('"&visitor&"', '"&visitor2&"', '"&visitormail&"', 1, '"&dcode&"', 'none', "&whatnow&")"
%><%=sql%><%
conn.execute(sql)
SQL output:
Code:
INSERT INTO students (sname1, sname2, semail, smembership, spass, saddress, sdatereg) VALUES ('Ralph', 'Test', 'ralph@test.com', 1, 'sNA9f214', 'none', 20\10\2010)
DB date output when redisplayed:
Code:
30\12\1899 or 00:01:26
I've tried using #s and converting to 'string' but nothing seems to get around it. How can I get the date to register properly?