Print Page | Close Window

db date format problem - sql statement

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=9379
Printed Date: 28 March 2026 at 4:39pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: db date format problem - sql statement
Posted By: Benji
Subject: db date format problem - sql statement
Date Posted: 30 January 2004 at 5:59am

I have an html form that collects info, then posts it to an asp page to insert them into an access db. They all work fine except the date part. I live in the UK so need the dd/mm/yy format, but when it gets put in the database it's going in as mm/dd/yy. Here's my sql query

strSQL = "SELECT request.name, request.department, request.telephone, request.reason, request.date_required, request.request, request.output, request.fields_required, request.[person requiring the information], [taken by], request.status, request.req_num FROM request;"

and here's the bit that adds it to the db

AddJob.CursorType = 2
'Set the lock type so that the record is locked by ADO when it is updated
AddJob.LockType = 3
'Open the recordset with the SQL query
AddJob.Open strSQL, adoCon
'Tell the recordset we are adding a new record to it
AddJob.AddNew
'Add a new record to the recordset
AddJob.Fields("name") = Request.Form("name")
AddJob.Fields("department") = Request.Form("department")
AddJob.Fields("telephone") = Request.Form("telephone")
AddJob.Fields("reason") = Request.Form("reason")
AddJob.Fields("date_required") = Request.Form("date_required")
AddJob.Fields("request") = Request.Form("request")
AddJob.Fields("output") = Request.Form("output")
AddJob.Fields("fields_required") = Request.Form("fields_required")
AddJob.Fields("person requiring the information") = Request.Form("person")
AddJob.Fields("taken by") = Request.Form("taken by")
AddJob.Fields("status") = Request.Form("status")
'Write the updated recordset to the database
AddJob.Update
'Reset server objects
AddJob.Close
Set AddJob = Nothing
Set adoCon = Nothing
'Redirect to the success page
Response.Redirect "success.asp"

Any ideas on the solution?

ps. the field in the db is set to a short date field (dd/mm/yy)

Thanks in advance, i'm an ASP newbie so please don't get all technical on me



-------------
Ben



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net