In my local computer, date has been set in this format - dd/MM/yyyy.
When I insert records in a MS-Access DB table using ASP.NET, then the
records get inserted in the Access DB table exactly in the same format
as what has been set in my local machine. For e.g. if today is 21st
February 2007 & the time is 10:45:32 AM, then this record gets
inserted in the Access DB table as
21/02/2007 10:45:32 AM
But when I try to insert the same record in the same Access DB table
using ASP, the record gets inserted as
02/21/2007 10:45:32 AM
i.e. the month (02) is displayed & then the day (21) is displayed &
this is causing problems for me since later in the application, I am
using the DataDiff function to find the number of days that have
elapsed since the record was inserted & todays date.
Can someone please suggest me a solution to rersolve this? It's
driving me crazy.
The column in the Access DB table where the date records get inserted
has the Date/Time data type. So Access isn't even allowing me insert
the date records in that column after I break-up the entire date into
day, month & year using DatePart. FOr e.g. the following code breaks
up todays date into day, month & year:
<%
only the date part is shown; the time part has been omitted
Dim strDay, strMonth, strYear, dtToday
strDay=DatePart("d",Now)
strMonth=DatePart("m",Now)
strYear=DatePart("yyyy",Now)
dtToday=strDay & "/" & strMonth & "/" & strYear
Set objRS=objConn.Execute("INSERT INTO ODate VALUES ('" & dtToday
& "')"
%>
The above produces the data type mismatch error. 3 3205
<rn**@rediffmail.comwrote in message
news:11**********************@h3g2000cwc.googlegro ups.com...
In my local computer, date has been set in this format - dd/MM/yyyy.
When I insert records in a MS-Access DB table using ASP.NET, then the
records get inserted in the Access DB table exactly in the same format
as what has been set in my local machine. For e.g. if today is 21st
February 2007 & the time is 10:45:32 AM, then this record gets
inserted in the Access DB table as
21/02/2007 10:45:32 AM
But when I try to insert the same record in the same Access DB table
using ASP, the record gets inserted as
02/21/2007 10:45:32 AM
i.e. the month (02) is displayed & then the day (21) is displayed &
this is causing problems for me since later in the application, I am
using the DataDiff function to find the number of days that have
elapsed since the record was inserted & todays date.
Can someone please suggest me a solution to rersolve this? It's
driving me crazy.
The column in the Access DB table where the date records get inserted
has the Date/Time data type. So Access isn't even allowing me insert
the date records in that column after I break-up the entire date into
day, month & year using DatePart. FOr e.g. the following code breaks
up todays date into day, month & year:
<%
only the date part is shown; the time part has been omitted
Dim strDay, strMonth, strYear, dtToday
strDay=DatePart("d",Now)
strMonth=DatePart("m",Now)
strYear=DatePart("yyyy",Now)
dtToday=strDay & "/" & strMonth & "/" & strYear
Set objRS=objConn.Execute("INSERT INTO ODate VALUES ('" & dtToday
& "')"
%>
The above produces the data type mismatch error.
First off, lets be clear that date/time data has no text format when stored
in the DB.
When using SQL code such as above the date format is MM/DD/YYYY regardless
of your locale settings. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: carverk |
last post by:
Hello All
I'm in the middle of moving a MS Access DB to a MySql backend.
I have figured out about 90% of the problems I have faced, execpt
for this one.
I have 3 Queries, which pull records...
|
by: Corky |
last post by:
This works:
db2 SELECT DISTINCT PROBLEM_OBJECTS.PROBLEM_ID FROM PROBLEM_OBJECTS
INNER JOIN PROBLEMS ON PROBLEM_OBJECTS.PROBLEM_ID =
PROBLEMS.PROBLEM_ID WHERE INTEGER(DAYS(CURRENT DATE) -...
|
by: Deano |
last post by:
Hi,
I generate a report using two dates (From and To). I notice if I enter
01/10/2003 that it is interpreted by Access as 10/01/2003 i.e 10th January
rather than 1st October as I intended.
...
|
by: Riegn Man |
last post by:
I have a problem with access and our time clocks. We have time clocks
that put out a .log file with the badge swipes for everybody. There is
one .log file for each day. I am pulling that data...
|
by: hardik |
last post by:
hi friends,
i am really surprized the way access behaves in date fields i mean
it's all ok when you have us time zone or us servers but if you have
diffrent timezone like uk then access creates...
|
by: thewilldog |
last post by:
Hello, I've reviewed the archives here to address the issue, but I'm still running into problems. I've got a table field populated with the record date in text "YYYYMMDD"
To convert it into a...
|
by: JJ |
last post by:
Here's the code.
$link="http://xbox360cheat.org";
$close_date=$_POST; #last content change check
if ($close_date == 0)
$close_date = date("Y-m-d H:m:s", mktime(12, 0, 0, date("m"), date...
|
by: W. eWatson |
last post by:
Are there some date and time comparison functions that would compare, say,
Is 10/05/05 later than 09/22/02? (or 02/09/22 format, yy/mm/dd)
Is 02/11/07 the same as 02/11/07?
Is 14:05:18 after...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |