SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Type mismatch: '[string: "-0-0"]'
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ntn104
Posting Yak Master

175 Posts

Posted - 05/15/2013 :  07:38:05  Show Profile  Reply with Quote
Hello everyone,

Please help me to figure out how to fix my error message for "Type mismatch: '[string: "-0-0"]'", and it point to below statement:

where a.dt_in between '" & SQLDate(rsReport("Creation_Date")) & "' and '" & SQLDate(DateAdd("d",1095, SQLDate(rsReport("Creation_date")))) & "'

Thanks,

russell
Pyro-ma-ni-yak

USA
5072 Posts

Posted - 05/15/2013 :  19:20:20  Show Profile  Visit russell's Homepage  Reply with Quote
You'll need to echo (response.write) the query so you can see it and figure out what's wrong.

And the values of your variables.

I'd guess your SQLDate(rsReport("Creation_date")) function is returning "-0-0" and the DateAdd() function is choking on that.

Edited by - russell on 05/15/2013 19:21:11
Go to Top of Page

ntn104
Posting Yak Master

175 Posts

Posted - 05/16/2013 :  11:12:14  Show Profile  Reply with Quote
There is a blank date in CREATION_DATE field, that was why it caused the problem I just added another sql statement to indicate where creation_date is null, then it clears the problem,
Thanks,

quote:
Originally posted by russell

You'll need to echo (response.write) the query so you can see it and figure out what's wrong.

And the values of your variables.

I'd guess your SQLDate(rsReport("Creation_date")) function is returning "-0-0" and the DateAdd() function is choking on that.


Edited by - ntn104 on 05/16/2013 12:36:56
Go to Top of Page

russell
Pyro-ma-ni-yak

USA
5072 Posts

Posted - 05/16/2013 :  15:32:45  Show Profile  Visit russell's Homepage  Reply with Quote
You're welcome. Glad you got it worked out.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000