[quoted text, click to view] On Wed, 14 Sep 2005 17:25:55 -0700, Raman Iyer [MS] wrote:
>[forwarding to the relational server newsgroup]
>
>"Ana" <nospam@yahoo.com> wrote in message
>news:OTOf7IIuFHA.2880@TK2MSFTNGP12.phx.gbl...
>> Hi,
>>
>> I've a dialog form which interacts with a stored procedure to select a
>> range of dates. A command moves the data to a report, in theory, but it's
>> not working.
>>
>> SELECT dbo.CLAIMS.CLAIM_ID, dbo.CLAIMS.NAME,
>>
>> dbo.CLAIMS.DATE_IN,
>>
>> dbo.CLAIMS.SALESMAN_ID
>>
>> FROM dbo.CLAIMS
>>
>> WHERE (dbo.CLAIMS.CLAIM_ID = @Salesman) AND
>>
>> (CAST(dbo.CLAIMS,DATE_IN AS datetime) BETWEEN @D_Start AND @D_End)
Hi Ana,
(Please don't remove the .server group if you reply; the .datamining
group is not on my list of active groups)
May I assume that the comma is a typo, and your actual code contains a
period?
[quoted text, click to view] >> The dates are stored in yyyymmdd format for which -> CAST.
Egads! Why are you storing dates in yyyymmdd format, instead of using
the builtin datatype datetime (or smalldatetime)?
Also, what datatype do you use for DATE_IN?
[quoted text, click to view] >> The report is blank (no info and no errors), however, when using the Query
>> Analyzer, the script works fine. Of course, replacing the variables (@)
>> with fixed data.
How are @D_Start and @D_End declared? And what is the result if you add
the following extra query to your code:
SELECT @D_Start, @D_End
Best, Hugo
--