April 11, 2014 at 7:19 am
declare @todate as date = '01/04/2012'
Is this meant to be April 1st or January 4th?
Why do you prepare two date variables, then use literals in your query?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 11, 2014 at 7:25 am
Actually I want the user to give values in runtime. Those two(@fromdate and @todate) are parameters.
For testing purpose I gave date ranges in literals.
its Jan 04 2012.MM/DD/YYYY format
April 11, 2014 at 7:29 am
aar.mba (4/11/2014)
Actually I want the user to give values in runtime. Those two(@fromdate and @todate) are parameters.For testing purpose I gave date ranges in literals.
its Jan 04 2012.MM/DD/YYYY format
What do you expect po_date (VARCHAR(10) or whatever) to implicitly convert to? What might cause the conversion to fail?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 11, 2014 at 7:38 am
Po_date to be converted to date format..
so that if the user enters the date in report then appropriate data should be fetched.
the date parameter in SSRS should be mapped to the column of same data type.
the default format for date parameter in ssrs is "mm/dd/yyyy".
Since the query works fine with "Late" status,i think the problem is with Po_date value corresponding to
"ontime" status
Is there any other way?
April 11, 2014 at 7:43 am
Also I ran the below query
select isdate(po_date)
from #mytable
where status = 'ontime'
select isdate(po_date)
from #mytable
where status = 'late'
for status "ontime" some of the rows returned 0
for status "late" all the rows returned 1
So the row which returned 0 has problem with the data of Po_date?
Pls note that ran all the queries what you sent in my UAT
April 11, 2014 at 8:00 am
Better to use an explicit conversion of string-date to actual date, than hope that local settings will accidentally give you the result you want with an implicit conversion.
CONVERT(DATE,po_date,101)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Viewing 6 posts - 16 through 20 (of 20 total)
You must be logged in to reply to this topic. Login to reply