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
Alan
"jason" <ja...@catamaranco.com> wrote in message
news:Ouu5fZNc...@TK2MSFTNGP12.phx.gbl...
UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" & NewPrice & ",
ChangeDate =#" & ChangeDate & "# WHERE PriceChangeID=" & PriceChangeID
dlbjr
Unambit from meager knowledge of inane others,
engender uncharted sagacity.
- Jason
"Alan" <XalanX....@XparadiseX.XnetX.XnzX> wrote in message
news:OKqlUfNc...@TK2MSFTNGP11.phx.gbl...
8:00:00 PM
Unbelievable.
"dlbjr" <dl...@dontknow.doyou> wrote in message
news:uO6MdxNc...@TK2MSFTNGP10.phx.gbl...
"Bob Barrows" <reb_...@yahoo.com> wrote in message
news:OPFWcDOc...@tk2msftngp13.phx.gbl...
Bob Barrows
I just cannot figure this out.
- Jason
"Bob Barrows" <reb_...@yahoo.com> wrote in message
news:#$tC2YOcD...@TK2MSFTNGP11.phx.gbl...
Bob
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
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" <reb_...@yahoo.com> wrote in message
news:ugD6i$VcDH...@tk2msftngp13.phx.gbl...
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
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" <reb_...@yahoo.com> wrote in message
news:enJbaPWc...@TK2MSFTNGP12.phx.gbl...
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
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" <reb_...@yahoo.com> wrote in message
news:uLm3ptWc...@TK2MSFTNGP11.phx.gbl...
dim d
dim d d= cdate("5/23/71")
d= d + cdate(FormatDateTime(now,vbShortTime))
Response.Write d
HTH,
Bob Barrows
:)
Jason
"Bob Barrows" <reb_...@yahoo.com> wrote in message
news:#LF2PsXc...@TK2MSFTNGP12.phx.gbl...