I'm tearing out my hair here: ACCESS 2000:
When I attempt to overwrite a date in my date field with a new user selected
valid date eg: 05/23/99
my date field changes to the TIME I updated the field
and does not display my desired date: 05/23/99
Instead it reads: 12:12:03 AM
I am going nuts - even considering converting the field to text. The field
is a SHORT DATE
Here is my sql statement:
ChangeDate = request.form.item("ChangeDate") '// 05/23/76
UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" & NewPrice & ",
ChangeDate =" & ChangeDate & " WHERE PriceChangeID =" & PriceChangeID
'Response.end cnn.Execute(UpdateSQL)
Here is the result:
UPDATE tblListingspriceChanges SET NewPrice =20002, ChangeDate =05/23/76
WHERE PriceChangeID =28
Here is what ChangeDate Field looks like in Access:
12:04:07 AM
- I have even tried Cdate(ChangeDate) but this appears to make no
difference.
- Jason 16 2180
Can't say if this is the cause for sure - I haven't used Access in ages, but
your dates should be delimited with #'s. Try that to see if it makes a
difference.
Alan
"jason" <ja***@catamaranco.com> wrote in message
news:Ou**************@TK2MSFTNGP12.phx.gbl... I'm tearing out my hair here: ACCESS 2000:
When I attempt to overwrite a date in my date field with a new user
selected valid date eg: 05/23/99 my date field changes to the TIME I updated the field and does not display my desired date: 05/23/99
Instead it reads: 12:12:03 AM
I am going nuts - even considering converting the field to text. The field is a SHORT DATE
Here is my sql statement:
ChangeDate = request.form.item("ChangeDate") '// 05/23/76
UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" & NewPrice &
", ChangeDate =" & ChangeDate & " WHERE PriceChangeID =" & PriceChangeID 'Response.end cnn.Execute(UpdateSQL)
Here is the result:
UPDATE tblListingspriceChanges SET NewPrice =20002, ChangeDate =05/23/76 WHERE PriceChangeID =28
Here is what ChangeDate Field looks like in Access:
12:04:07 AM
- I have even tried Cdate(ChangeDate) but this appears to make no difference.
- Jason
Try this
UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" & NewPrice & ",
ChangeDate =#" & ChangeDate & "# WHERE PriceChangeID=" & PriceChangeID
dlbjr
Unambit from meager knowledge of inane others,
engender uncharted sagacity.
Man, I don't know: I tried doing this:
ChangeDate="#" & ChangeDate & "#"
....but then this generates a syntax error. There has got to be simple way to
insert a date into the date field of Access....
- Jason
"Alan" <Xa*************@XparadiseX.XnetX.XnzX> wrote in message
news:OK**************@TK2MSFTNGP11.phx.gbl... Can't say if this is the cause for sure - I haven't used Access in ages,
but your dates should be delimited with #'s. Try that to see if it makes a difference.
Alan
"jason" <ja***@catamaranco.com> wrote in message news:Ou**************@TK2MSFTNGP12.phx.gbl... I'm tearing out my hair here: ACCESS 2000:
When I attempt to overwrite a date in my date field with a new user selected valid date eg: 05/23/99 my date field changes to the TIME I updated the field and does not display my desired date: 05/23/99
Instead it reads: 12:12:03 AM
I am going nuts - even considering converting the field to text. The
field is a SHORT DATE
Here is my sql statement:
ChangeDate = request.form.item("ChangeDate") '// 05/23/76
UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" & NewPrice & ", ChangeDate =" & ChangeDate & " WHERE PriceChangeID =" & PriceChangeID 'Response.end cnn.Execute(UpdateSQL)
Here is the result:
UPDATE tblListingspriceChanges SET NewPrice =20002, ChangeDate =05/23/76 WHERE PriceChangeID =28
Here is what ChangeDate Field looks like in Access:
12:04:07 AM
- I have even tried Cdate(ChangeDate) but this appears to make no difference.
- Jason
No, that still does not work - no error - but this is what it puts in my
changeDate field:
8:00:00 PM
Unbelievable.
"dlbjr" <dl***@dontknow.doyou> wrote in message
news:uO**************@TK2MSFTNGP10.phx.gbl... Try this
UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" & NewPrice &
", ChangeDate =#" & ChangeDate & "# WHERE PriceChangeID=" & PriceChangeID
dlbjr
Unambit from meager knowledge of inane others, engender uncharted sagacity.
What do you get when you do this:
Response.Write UpdateSQL
jason wrote: No, that still does not work - no error - but this is what it puts in my changeDate field:
8:00:00 PM
Unbelievable. "dlbjr" <dl***@dontknow.doyou> wrote in message news:uO**************@TK2MSFTNGP10.phx.gbl... Try this
UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" & NewPrice & ", ChangeDate =#" & ChangeDate & "# WHERE PriceChangeID=" & PriceChangeID
dlbjr
Unambit from meager knowledge of inane others, engender uncharted sagacity.
UPDATE tblListingspriceChanges SET NewPrice =20002, ChangeDate =#05/23/76#
WHERE PriceChangeID =28
"Bob Barrows" <re*******@yahoo.com> wrote in message
news:OP**************@tk2msftngp13.phx.gbl... What do you get when you do this: Response.Write UpdateSQL jason wrote: No, that still does not work - no error - but this is what it puts in my changeDate field:
8:00:00 PM
Unbelievable. "dlbjr" <dl***@dontknow.doyou> wrote in message news:uO**************@TK2MSFTNGP10.phx.gbl... Try this
UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" & NewPrice & ", ChangeDate =#" & ChangeDate & "# WHERE PriceChangeID=" & PriceChangeID
dlbjr
Unambit from meager knowledge of inane others, engender uncharted sagacity.
Well, that SHOULD work, assuming that you want to set the field to
26-May-1976 ...
You say that this results in 8:00:00 PM ...?
What if you open Access and use the Query builder to run this statement?
Bob Barrows
jason wrote: UPDATE tblListingspriceChanges SET NewPrice =20002, ChangeDate =#05/23/76# WHERE PriceChangeID =28
"Bob Barrows" <re*******@yahoo.com> wrote in message news:OP**************@tk2msftngp13.phx.gbl... What do you get when you do this: Response.Write UpdateSQL jason wrote: No, that still does not work - no error - but this is what it puts in my changeDate field:
8:00:00 PM
Unbelievable. "dlbjr" <dl***@dontknow.doyou> wrote in message news:uO**************@TK2MSFTNGP10.phx.gbl... Try this
UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" & NewPrice & ", ChangeDate =#" & ChangeDate & "# WHERE PriceChangeID=" & PriceChangeID
dlbjr
Unambit from meager knowledge of inane others, engender uncharted sagacity.
If I run the query in Access it results in: 05/26/71.
I just cannot figure this out.
- Jason
"Bob Barrows" <re*******@yahoo.com> wrote in message
news:#$**************@TK2MSFTNGP11.phx.gbl... Well, that SHOULD work, assuming that you want to set the field to 26-May-1976 ... You say that this results in 8:00:00 PM ...? What if you open Access and use the Query builder to run this statement?
Bob Barrows
jason wrote: UPDATE tblListingspriceChanges SET NewPrice =20002, ChangeDate =#05/23/76# WHERE PriceChangeID =28
"Bob Barrows" <re*******@yahoo.com> wrote in message news:OP**************@tk2msftngp13.phx.gbl... What do you get when you do this: Response.Write UpdateSQL jason wrote: No, that still does not work - no error - but this is what it puts in my changeDate field:
8:00:00 PM
Unbelievable. "dlbjr" <dl***@dontknow.doyou> wrote in message news:uO**************@TK2MSFTNGP10.phx.gbl... > Try this > > UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" & > NewPrice & ", ChangeDate =#" & ChangeDate & "# WHERE > PriceChangeID=" & PriceChangeID > > > dlbjr > > Unambit from meager knowledge of inane others, > engender uncharted sagacity.
Something is definitely strange. "05/23/76" becomes "05/26/71"?!?
ChangeDate IS a Date/Time field isn't it?
Bob
jason wrote: If I run the query in Access it results in: 05/26/71.
I just cannot figure this out.
- Jason "Bob Barrows" <re*******@yahoo.com> wrote in message news:#$**************@TK2MSFTNGP11.phx.gbl... Well, that SHOULD work, assuming that you want to set the field to 26-May-1976 ... You say that this results in 8:00:00 PM ...? What if you open Access and use the Query builder to run this statement?
Bob Barrows
jason wrote: UPDATE tblListingspriceChanges SET NewPrice =20002, ChangeDate =#05/23/76# WHERE PriceChangeID =28
"Bob Barrows" <re*******@yahoo.com> wrote in message news:OP**************@tk2msftngp13.phx.gbl... What do you get when you do this: Response.Write UpdateSQL jason wrote: > No, that still does not work - no error - but this is what it puts > in my changeDate field: > > 8:00:00 PM > > Unbelievable. > "dlbjr" <dl***@dontknow.doyou> wrote in message > news:uO**************@TK2MSFTNGP10.phx.gbl... >> Try this >> >> UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" & >> NewPrice & ", ChangeDate =#" & ChangeDate & "# WHERE >> PriceChangeID=" & PriceChangeID >> >> >> dlbjr >> >> Unambit from meager knowledge of inane others, >> engender uncharted sagacity.
I can't reproduce this symptom. When I use UPDATE, the new date gets put
into the field.
I'm intrigued. Can you export the table to a new database and send it to me
offline along with the code you're attempting to use to update it? I'll try
and take a look at it by tonight.
Bob Barrows
jason wrote: Yeah - its a date/time field - is it possible that if you try to overwrite the field with the same date it gets confused and differentiates the two by the TIME rather than just displaying the date...man, this is such a time waster! "Bob Barrows" <re*******@yahoo.com> wrote in message news:eK**************@tk2msftngp13.phx.gbl... Something is definitely strange. "05/23/76" becomes "05/26/71"?!? ChangeDate IS a Date/Time field isn't it?
Bob jason wrote: If I run the query in Access it results in: 05/26/71.
I just cannot figure this out.
- Jason "Bob Barrows" <re*******@yahoo.com> wrote in message news:#$**************@TK2MSFTNGP11.phx.gbl... Well, that SHOULD work, assuming that you want to set the field to 26-May-1976 ... You say that this results in 8:00:00 PM ...? What if you open Access and use the Query builder to run this statement?
Bob Barrows
jason wrote: > UPDATE tblListingspriceChanges SET NewPrice =20002, ChangeDate > =#05/23/76# WHERE PriceChangeID =28 > > "Bob Barrows" <re*******@yahoo.com> wrote in message > news:OP**************@tk2msftngp13.phx.gbl... >> What do you get when you do this: >> Response.Write UpdateSQL >> >> >> >> jason wrote: >>> No, that still does not work - no error - but this is what it >>> puts in my changeDate field: >>> >>> 8:00:00 PM >>> >>> Unbelievable. >>> "dlbjr" <dl***@dontknow.doyou> wrote in message >>> news:uO**************@TK2MSFTNGP10.phx.gbl... >>>> Try this >>>> >>>> UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" & >>>> NewPrice & ", ChangeDate =#" & ChangeDate & "# WHERE >>>> PriceChangeID=" & PriceChangeID >>>> >>>> >>>> dlbjr >>>> >>>> Unambit from meager knowledge of inane others, >>>> engender uncharted sagacity.
Hi Bob - sure - you can I send you a link to download from your email
address rather than posting here?
Further as an aside: I just tried again and I noticed something very
strange:
UPDATE tblListingspriceChanges SET NewPrice =20002, ChangeDate =05/23/99
WHERE PriceChangeID =28
....Produced the following in the field called ChangeDate: 12/30/1899
But
When I click in the field it suddenly changes to time: 12:03:10 AM
AND
When I go to another field it reverts back to: 12/30/1899
It must have something to do with the format of the Date/Time field which is
currently set to Short Date. I have fooled around with changing options but
this does not make a difference.
"Bob Barrows" <re*******@yahoo.com> wrote in message
news:ug*************@tk2msftngp13.phx.gbl... I can't reproduce this symptom. When I use UPDATE, the new date gets put into the field.
I'm intrigued. Can you export the table to a new database and send it to
me offline along with the code you're attempting to use to update it? I'll
try and take a look at it by tonight.
Bob Barrows jason wrote: Yeah - its a date/time field - is it possible that if you try to overwrite the field with the same date it gets confused and differentiates the two by the TIME rather than just displaying the date...man, this is such a time waster! "Bob Barrows" <re*******@yahoo.com> wrote in message news:eK**************@tk2msftngp13.phx.gbl... Something is definitely strange. "05/23/76" becomes "05/26/71"?!? ChangeDate IS a Date/Time field isn't it?
Bob jason wrote: If I run the query in Access it results in: 05/26/71.
I just cannot figure this out.
- Jason "Bob Barrows" <re*******@yahoo.com> wrote in message news:#$**************@TK2MSFTNGP11.phx.gbl... > Well, that SHOULD work, assuming that you want to set the field to > 26-May-1976 ... > You say that this results in 8:00:00 PM ...? > What if you open Access and use the Query builder to run this > statement? > > Bob Barrows > > jason wrote: >> UPDATE tblListingspriceChanges SET NewPrice =20002, ChangeDate >> =#05/23/76# WHERE PriceChangeID =28 >> >> "Bob Barrows" <re*******@yahoo.com> wrote in message >> news:OP**************@tk2msftngp13.phx.gbl... >>> What do you get when you do this: >>> Response.Write UpdateSQL >>> >>> >>> >>> jason wrote: >>>> No, that still does not work - no error - but this is what it >>>> puts in my changeDate field: >>>> >>>> 8:00:00 PM >>>> >>>> Unbelievable. >>>> "dlbjr" <dl***@dontknow.doyou> wrote in message >>>> news:uO**************@TK2MSFTNGP10.phx.gbl... >>>>> Try this >>>>> >>>>> UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" & >>>>> NewPrice & ", ChangeDate =#" & ChangeDate & "# WHERE >>>>> PriceChangeID=" & PriceChangeID >>>>> >>>>> >>>>> dlbjr >>>>> >>>>> Unambit from meager knowledge of inane others, >>>>> engender uncharted sagacity.
jason wrote: Hi Bob - sure - you can I send you a link to download from your email address rather than posting here?
Further as an aside: I just tried again and I noticed something very strange:
UPDATE tblListingspriceChanges SET NewPrice =20002, ChangeDate =05/23/99 WHERE PriceChangeID =28
...Produced the following in the field called ChangeDate: 12/30/1899
This is because you failed to put the date delimiters around the date. The
statement should be:
.... =#05/23/99# WHERE PriceChangeID =28
Without the delimiters, Jet treats it as a numeric expression. The two
divisions result in a very small fractional number. This where you need to
realize that Jet stores dates as numbers of type Double. The whole number
portion of the number represents the number of days since the seed date:
12/30/1899. The decimal portion represents the time of day, with .5
equalling noon. The result of 5/23/99 is 0.0022. When interpreted as a
date/time, this is equivalent to 12/30/1899 00:05:16. Does this make it any
clearer?
Bob Barrows
Ok Ray - I got it - sorry If I was slow off the mark - got really tired and
error prone.
One more thing, I would like to bring up. One of my queries extracts the
latest price reductions by date and displays it in browser and it works
great! But,
I notice that if the user posts multiple price reductions on the same day
for the same boat it results in duplication of records. Now, in all
likelihood this would never happen. But, I supsect a solution to my problem
would be to store the TIME after the DATE:
05/23/71 8.002 pm ...which would always keep my records in the query unique.
Is this small/date time and if so what is the correct format inside Access
for the date/time field. Also, will it affect existing queries, updates or
inserts etc if I switch to storing date values like this?
Appreciated
Jason
"Bob Barrows" <re*******@yahoo.com> wrote in message
news:en**************@TK2MSFTNGP12.phx.gbl... jason wrote: Hi Bob - sure - you can I send you a link to download from your email address rather than posting here?
Further as an aside: I just tried again and I noticed something very strange:
UPDATE tblListingspriceChanges SET NewPrice =20002, ChangeDate =05/23/99 WHERE PriceChangeID =28
...Produced the following in the field called ChangeDate: 12/30/1899 This is because you failed to put the date delimiters around the date. The statement should be: ... =#05/23/99# WHERE PriceChangeID =28
Without the delimiters, Jet treats it as a numeric expression. The two divisions result in a very small fractional number. This where you need to realize that Jet stores dates as numbers of type Double. The whole number portion of the number represents the number of days since the seed date: 12/30/1899. The decimal portion represents the time of day, with .5 equalling noon. The result of 5/23/99 is 0.0022. When interpreted as a date/time, this is equivalent to 12/30/1899 00:05:16. Does this make it
any clearer?
Bob Barrows
Ok - how would append the time to the end of my user defined date in Access.
Would I need to do string manipulation on:
Now() which produces: 9/2/2003 12:38:31 PM
to get: 12:38:31
And add it to my user defined date eg: 05/23/71 (I am following the sequence
Access gives me: month, day, year)
To get:
#05/23/71 12:38:31#
?
Thanks
jason
"Bob Barrows" <re*******@yahoo.com> wrote in message
news:uL**************@TK2MSFTNGP11.phx.gbl... jason wrote: Ok Ray - I got it - sorry If I was slow off the mark - got really tired and error prone. Ray?? Well I never ... ;-)
One more thing, I would like to bring up. One of my queries extracts the latest price reductions by date and displays it in browser and it works great! But,
I notice that if the user posts multiple price reductions on the same day for the same boat it results in duplication of records. Now, in all likelihood this would never happen. But, I supsect a solution to my problem would be to store the TIME after the DATE:
05/23/71 8.002 pm ...which would always keep my records in the query unique. Is this small/date time and if so what is the correct format inside Access for the date/time field. Also, will it affect existing queries, updates or inserts etc if I switch to storing date values like this?
Again, Access date/time fields know nothing about format. Datetimes are stored as Doubles. Both time and date are always stored: if you don't
supply a time, .0 is stored.
When supplying dates and times, you should use this format: yyyy-mm-dd hh:mm:ss. So your date should be supplied as: #1971-05-23 20:02:00#
HTH, Bob Barrows
jason wrote: Ok - how would append the time to the end of my user defined date in Access. Would I need to do string manipulation on: Now() which produces: 9/2/2003 12:38:31 PM
to get: 12:38:31
And add it to my user defined date eg: 05/23/71 (I am following the sequence Access gives me: month, day, year)
To get:
#05/23/71 12:38:31#
?
Sure! That would work.Although, instead of string manipulation, you can use
FormatDateTime to extract the Short Time:
dim d
dim d d= cdate("5/23/71")
d= d + cdate(FormatDateTime(now,vbShortTime))
Response.Write d
HTH,
Bob Barrows
Works like a dream thanks - amazing what one can learn in the matter of 48
hours!
:)
Jason
"Bob Barrows" <re*******@yahoo.com> wrote in message
news:#L**************@TK2MSFTNGP12.phx.gbl... jason wrote: Ok - how would append the time to the end of my user defined date in Access. Would I need to do string manipulation on: Now() which produces: 9/2/2003 12:38:31 PM
to get: 12:38:31
And add it to my user defined date eg: 05/23/71 (I am following the sequence Access gives me: month, day, year)
To get:
#05/23/71 12:38:31#
? Sure! That would work.Although, instead of string manipulation, you can
use FormatDateTime to extract the Short Time:
dim d dim d d= cdate("5/23/71") d= d + cdate(FormatDateTime(now,vbShortTime)) Response.Write d
HTH, Bob Barrows
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: perplexed |
last post by:
How do you convert a user inputted date to a unix timestamp before
insterting it into your database? I have a form, with a textfield for
a date that the user inputs in the format mm-dd-yyyy and...
|
by: Piotr Pietrowski |
last post by:
Hello everybody,
I have a *big* problem. I thought its not that big problem for you
professionals...
Anyway, I have a begin date which has 3 dropdown boxes
(day/Month/Year).
The same for the...
|
by: Ed Bick |
last post by:
Well, I read today about how I could set the dropdown value to False to
change the control from presenting a Calendar to cycling through the times.
Before getting that, I developed a custom Time...
|
by: Jeffrey W. Baker |
last post by:
Greetings,
I have a 23GB data table upon which I am building a primary key of three
columns. The data is mounted in a 137GB device and pg_xlog is mounted
on a separate 3.5GB device. I have...
|
by: PC Datasheet |
last post by:
Transaction data is given with date ranges:
Beginning End
4/1/06 4/4/06
4/7/06 4/11/06
4/14/06 4/17/06
4/18/06 4/21/06
426/06 ...
|
by: peteh |
last post by:
Hi All;
We have many production jobs that "load from cursor" to a UDB/AIX 8.2
(with dpf) data warehouse from source tables residing Oracle 9i. Since
Oracle dates are (roughly) equivalent to DB2...
|
by: Rsapru |
last post by:
i have a table containing following data
effdate termdate uid
----------- ----------- -----------
1 2 1
3 4 2
5 8 3
7 ...
|
by: Danigan |
last post by:
I could about swear this was working perfectly while I was adding some other functionality somewhere else. I now removed that functionality and it doesn't work. If someone could find what I broke,...
|
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: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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: 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...
| |