Hello all. I have a situation which I hope I word correctly. I am writing 2 .ASP pages to dynamically create XML for a Gantt chart that I am using, and during my testing, I started getting the following error on one of the pages:
Microsoft OLE DB Provider for SQL Server error '80040e07'
The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value.
/charts2/data_gantt_xml2.a
sp, line 344
I have a main page which pulls XML data from the other two pages and displays two flash Gantt charts, one for the first six months of data, and another for the last six months of data. The first one is working fine, but the second one is not. The only difference between the two files creating the XML is the following, in which I am just giving each process a starting point.
These work - (First ASP/XML sheet)
Month1 = "3/15/2006"
Month2 = DateAdd("m",1,"3/15/2006")
Month3 = DateAdd("m",2,"3/15/2006")
Month4 = DateAdd("m",3,"3/15/2006")
Month5 = DateAdd("m",4,"3/15/2006")
Month6 = DateAdd("m",5,"3/15/2006")
These DON'T work - (Second ASP/XML sheet)
Month1 = DateAdd("m",6,"3/15/2006")
Month2 = DateAdd("m",7,"3/15/2006")
Month3 = DateAdd("m",8,"3/15/2006")
Month4 = DateAdd("m",9,"3/15/2006")
Month5 = DateAdd("m",10,"3/15/2006"
)
Month6 = DateAdd("m",11,"3/15/2006"
)
Although, I noticed by just changing the amount of the interval in the DateAdd() function down by one it works. For example, I changed:
Month1 = DateAdd("m",6,"3/15/2006")
to Month1 = DateAdd("m",5,"3/15/2006")
.. and so on through the rest of them. But I did notice that some combinations still fail.
I even tried this and just changing the month of 'date1' some would work and some wouldn't.
date1 = "6/15/2006"
date1 = FormatDateTime(date1,2)
Month1 = DateAdd("m",8,date1)
Month2 = DateAdd("m",9,date1)
Month3 = DateAdd("m",10,date1)
Month4 = DateAdd("m",11,date1)
Month5 = DateAdd("m",12,date1)
Month6 = DateAdd("m",13,date1)
Sorry for the long post, and any suggestions would be greatly appreciated.
Thanks,
Mike