You didn't mention the specifics of the problem you are having (i.e. error
message, unexpected results).
The date parameter is passed from a VB app as a text value in the format
mm/dd/yy.
I suggest you use neutral DATAFORMAT literal strings ('YYYYMMDD' or
'YYYY-MM-DDTHH:MM:SS'). A better method here is to use parameterized SQL
statements in your VB code so that you don't need to be concerned with
formatting date strings or doubling up quotes in text strings.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Charlie" <ja******@yahoo.comwrote in message
news:47**********************@roadrunner.com...
The following is part of my stored procedure where I could use some help:
If I remark out the two lines regarding dates, it runs fine. The date
parameter is passed from a VB app as a text value in the format mm/dd/yy.
Thanks for any help.
Charlie
SELECT * FROM dbo.TWQRHISTEARDOWN_HEADER where
(WQR_TDH_MODELYEAR_T=@Model_Year OR @Model_Year IS NULL)
AND (WQR_TDH_OFFLINEDT_Y>=@Start_Date OR @Start_Date IS NULL)
AND (WQR_TDH_OFFLINEDT_Y<=@Stop_Date OR @Stop_Date IS NULL)