Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - db date format problem - sql statement
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

db date format problem - sql statement

 Post Reply Post Reply
Author
Benji View Drop Down
Newbie
Newbie
Avatar

Joined: 19 March 2002
Location: United Kingdom
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote Benji Quote  Post ReplyReply Direct Link To This Post Topic: db date format problem - sql statement
    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



Edited by Benji
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.