|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
The following is part of my stored procedure where I could use some :
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 . 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) |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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 s. Dan Guzman SQL Server MVP "Charlie" <jadkins4@yahoo.com> wrote in message news:476593ee$0$8888$4c368faf@roadrunner.com... > The following is part of my stored procedure where I could use some : > 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 . > 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) > > |
|
![]() |
| Outils de la discussion | |
|
|