Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Date Insert puzzle :: 05/23/76 becomes 12: 12:13

Reply
Thread Tools

Date Insert puzzle :: 05/23/76 becomes 12: 12:13

 
 
jason
Guest
Posts: n/a
 
      09-01-2003
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






 
Reply With Quote
 
 
 
 
Alan
Guest
Posts: n/a
 
      09-01-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>
>
>
>



 
Reply With Quote
 
 
 
 
dlbjr
Guest
Posts: n/a
 
      09-01-2003
Try this

UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" & NewPrice & ",
ChangeDate =#" & ChangeDate & "# WHERE PriceChangeID=" & PriceChangeID


dlbjr

Unambit from meager knowledge of inane others,
engender uncharted sagacity.


 
Reply With Quote
 
jason
Guest
Posts: n/a
 
      09-01-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >
> >
> >
> >
> >

>
>



 
Reply With Quote
 
jason
Guest
Posts: n/a
 
      09-01-2003
No, that still does not work - no error - but this is what it puts in my
changeDate field:

8:00:00 PM

Unbelievable.
"dlbjr" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Try this
>
> UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" & NewPrice &

",
> ChangeDate =#" & ChangeDate & "# WHERE PriceChangeID=" & PriceChangeID
>
>
> dlbjr
>
> Unambit from meager knowledge of inane others,
> engender uncharted sagacity.
>
>



 
Reply With Quote
 
Bob Barrows
Guest
Posts: n/a
 
      09-01-2003
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Try this
>>
>> UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" &
>> NewPrice & ", ChangeDate =#" & ChangeDate & "# WHERE PriceChangeID="
>> & PriceChangeID
>>
>>
>> dlbjr
>>
>> Unambit from meager knowledge of inane others,
>> engender uncharted sagacity.




 
Reply With Quote
 
jason
Guest
Posts: n/a
 
      09-01-2003
UPDATE tblListingspriceChanges SET NewPrice =20002, ChangeDate =#05/23/76#
WHERE PriceChangeID =28

"Bob Barrows" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> Try this
> >>
> >> UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" &
> >> NewPrice & ", ChangeDate =#" & ChangeDate & "# WHERE PriceChangeID="
> >> & PriceChangeID
> >>
> >>
> >> dlbjr
> >>
> >> Unambit from meager knowledge of inane others,
> >> engender uncharted sagacity.

>
>
>



 
Reply With Quote
 
Bob Barrows
Guest
Posts: n/a
 
      09-02-2003
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> Try this
>>>>
>>>> UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" &
>>>> NewPrice & ", ChangeDate =#" & ChangeDate & "# WHERE
>>>> PriceChangeID=" & PriceChangeID
>>>>
>>>>
>>>> dlbjr
>>>>
>>>> Unambit from meager knowledge of inane others,
>>>> engender uncharted sagacity.




 
Reply With Quote
 
jason
Guest
Posts: n/a
 
      09-02-2003
If I run the query in Access it results in: 05/26/71.

I just cannot figure this out.

- Jason
"Bob Barrows" <(E-Mail Removed)> wrote in message
news:#$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> 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" <(E-Mail Removed)> wrote in message
> >>> news:(E-Mail Removed)...
> >>>> Try this
> >>>>
> >>>> UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" &
> >>>> NewPrice & ", ChangeDate =#" & ChangeDate & "# WHERE
> >>>> PriceChangeID=" & PriceChangeID
> >>>>
> >>>>
> >>>> dlbjr
> >>>>
> >>>> Unambit from meager knowledge of inane others,
> >>>> engender uncharted sagacity.

>
>
>



 
Reply With Quote
 
Bob Barrows
Guest
Posts: n/a
 
      09-02-2003
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" <(E-Mail Removed)> wrote in message
> news:#$(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> 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" <(E-Mail Removed)> wrote in message
>>>>> news:(E-Mail Removed)...
>>>>>> Try this
>>>>>>
>>>>>> UpdateSQL = "UPDATE tblListingspriceChanges SET NewPrice =" &
>>>>>> NewPrice & ", ChangeDate =#" & ChangeDate & "# WHERE
>>>>>> PriceChangeID=" & PriceChangeID
>>>>>>
>>>>>>
>>>>>> dlbjr
>>>>>>
>>>>>> Unambit from meager knowledge of inane others,
>>>>>> engender uncharted sagacity.




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
and becomes or and or becomes and Stef Mientki Python 9 05-28-2011 02:04 PM
Reversing Bit Order.. i.e. MSB becomes bit 0, LSB becomes bit 15 benn686@hotmail.com C++ 9 08-22-2007 12:13 AM
RAM - 2gb becomes 4gb becomes 2gb b Computer Support 10 04-27-2006 11:58 PM
A puzzle to puzzle you sk A+ Certification 1 07-17-2004 05:19 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM



Advertisments