Here is a working code snippet against AdventureWorks DB. I also noted you
were trying to evalute just TIME inside a DATE column, is that what you
wanted?
select *
from production.billofmaterials
Where UnitMeasureCode='EA'
and EndDate between '1/5/2000' and '1/1/2006'
[quoted text, click to view] "XMcknight" <XMcknight@discussions.microsoft.com> wrote in message
news:9668A9C6-5EE3-4D8A-8BD6-A2A71B36B990@microsoft.com...
> I'm new to this, so bear with me. :) But I'm creating a CRM report using
> Visual Studio and SQL 2000. I would like be able to query on specific
> dates
> when this report is run, but I'm having trouble with the syntax I need to
> use.
>
> Here's what I have:
>
> SELECT vSalesActivitySummary.Activity_Count,
> vSalesActivitySummary.FullName, vSalesActivitySummary.Activity_Type,
> vSalesActivitySummary.CreatedOn,
> OpportunityClose.StateCode
> FROM vSalesActivitySummary CROSS JOIN
> OpportunityClose
> WHERE (OpportunityClose.StateCode = 2) OR
> (OpportunityClose.StateCode = 3)
> ORDER BY vSalesActivitySummary.FullName,
> vSalesActivitySummary.Activity_Type
>
> Now, I had access to a similar previous report that had the date selection
> criteria that I'm looking for, but when I copy and paste it into my
> report, I
> get an error:
>
> WHERE (CreatedOn BETWEEN @Start_Date + ' 00:00:00.000' AND @End_Date +
> '
> 23:59:59.000')
> **CreatedOn is t he attribute I'm also trying to use in my own query**
>
> I'm sure the problem is also related to where I'm trying to insert the
> statement, and that's probably what I need help with.
>
> Thanks in advance!