Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

smalldatetime error

Status
Not open for further replies.

jordan11

Technical User
May 24, 2003
150
0
0
GB
Hi,
I get this error message
The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value.

when try to insert the code below

theMonth = "dbo.tbl_banners" & Month(Today())
MM_editTable = "dbo.tbl_banners" & Month(Today())

MM_editTable = "insert into " & MM_editTable & " (agencyID,month) VALUES (" & Request("agencyID") & ",'" & Today() & "')"


can anyone tell me how to get around this problem

thanks JJ
 
Can we see the implmentation of your Today() function? It might be returning DateTime.Now.ToString() instead of DateTime.Now.ToShortDateString() or something.
 
sorry I did not write this code.

the only other piece of other information I have is

<input type="hidden" name="month" value="<%=Today()%>">

by the way the database is access

Thanks
 
I think the poster means they are using the System.DateTime.Today() function. As BoulderBum suggested, use a sgort date string instead.

Also, you say that your database is MS Access - I didn't think the smalldatetime data type was supported by Access although I could be wrong...


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
sorry they are using access for there forun and sql server for the rest of the site.
I have now solved the problem.

Thanks for your help
 
How did you solve the problem?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top