Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / June 2003



Tip: Looking for answers? Try searching our database.

Date problems with SQL (previously Access code)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave Navarro - 30 Jun 2003 11:59 GMT
I have the following code:

biddate = request("close_month") & "/" & request("close_day") & "/" &
request("close_year")
bidtime = request("close_time") & " " & request("close_ampm")

userRS.Fields("bid_date")      = biddate & " " & bidtime

And I'm getting the following error:

 Provider error '80020005'
 Type mismatch.

I've tried swapping the month and day values, with no luck.  I checked
ASPFAQ.COM, but all the code I found used "INSERT" to insert the record.  
This code is being ported over from using an Access database and if I
have to change all these records over to using INSERT, it's going to add
MANY hours to the conversion time and we're past our original deadline
already.

Thanks for any help anyone can provide.

--Dave
Bob Barrows - 30 Jun 2003 12:48 GMT
Well, whoever wrote this code originally should have done it correctly in
the first place. You really should be rewriting it to use DML SQL instead of
recordsets, but I understand if you just want to get this running now, and
hopefully rewrite it later.

You say you are porting, does that mean you are now going to be using SQL
Server? I realize that you mention "SQL" in the subject, but Access uses the
SQL language also. It always helps to specify the database type AND version.
Granted, the version isn't really relevant here, but it may be in a future
question, so please get into the habit of telling us both upffront, OK? :-)

I'm going to assume you meant SQL Server.

Let's start with some basic debugging: response.write the biddate and
bidtime variables to make sure they contain what you think they contain.
Show us the results of the response.writes.

It's been awhile since I updated a recordset, but I would expect this to
work (passing the time in 24hr format rather than AM/PM):

userRS.Fields("bid_date")      = #20030630 07:45:00#

So try getting your expression to result in something that looks the above -
you may have to use CDate("20030630 07:45:00"). Let us know what works.

Bob Barrows

> I have the following code:
>
[quoted text clipped - 19 lines]
>
> --Dave
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.