From: SMXBob on 16 Apr 2010 01:46 I have a slight problem resetting a date select parameter in that I can't get the records with null dates. For instance this select statement SelectCommand="SELECT * FROM [MyTable] WHERE ([DueDate] < @DueDateParm)" <asp:SessionParameter Name="DueDateParm" SessionField="DueDateParm" DefaultValue="" ConvertEmptyStringToNull="true" DbType="DateTime" /> If I set DueDateParm to a date it works fine I get all of the recors less than that date. But I can't figure out how to reset it so every record comes back.Records with Null dates are not selected. The only method I can find is Clear but it clears ALL parameters. I just want to reset this one. Thanks for any suggestionsk
From: Alexey Smirnov on 16 Apr 2010 02:27 On Apr 16, 7:46 am, "SMXBob" <smx...(a)seametrix.com> wrote: > I have a slight problem resetting a date select parameter in that I can't > get the records with null dates. > For instance this select statement > > SelectCommand="SELECT * FROM [MyTable] WHERE ([DueDate] < @DueDateParm)" > > <asp:SessionParameter > Name="DueDateParm" > SessionField="DueDateParm" > DefaultValue="" > ConvertEmptyStringToNull="true" > DbType="DateTime" /> > > If I set DueDateParm to a date it works fine I get all of the recors less > than that date. But I can't figure out how to reset it so every record comes > back.Records with Null dates are not selected. > The only method I can find is Clear but it clears ALL parameters. I just > want to reset this one. > > Thanks for any suggestionsk I think you can set the date of tomorrow to show all records.
From: Andrew Morton on 16 Apr 2010 05:39 SMXBob wrote: > I have a slight problem resetting a date select parameter in that I > can't get the records with null dates. > For instance this select statement > > SelectCommand="SELECT * FROM [MyTable] WHERE ([DueDate] < @DueDateParm)" If you want to include the null ones, then surely you'd want to include them in the predicate: SELECT * FROM [MyTable] WHERE ([DueDate] < @DueDateParm OR [DueDate] IS NULL) -- Andrew
From: SMXBob on 16 Apr 2010 11:05 Please notice what I am trying to do here. If I set the DueDateParm to a date I get all the records less then that date (see my query). The result set does NOT include nulls which is how it is suppose to work. What I then want is the option to return all rows including nulls. The OR option would work but I am back to my initial problem how do I remove it when I want just my date selection. "SMXBob" <smxbob(a)seametrix.com> wrote in message news:%23w5bugS3KHA.4332(a)TK2MSFTNGP02.phx.gbl... >I have a slight problem resetting a date select parameter in that I can't >get the records with null dates. > For instance this select statement > > SelectCommand="SELECT * FROM [MyTable] WHERE ([DueDate] < @DueDateParm)" > > <asp:SessionParameter > Name="DueDateParm" > SessionField="DueDateParm" > DefaultValue="" > ConvertEmptyStringToNull="true" > DbType="DateTime" /> > > If I set DueDateParm to a date it works fine I get all of the recors less > than that date. But I can't figure out how to reset it so every record > comes back.Records with Null dates are not selected. > The only method I can find is Clear but it clears ALL parameters. I just > want to reset this one. > > Thanks for any suggestionsk >
From: Paul Shapiro on 16 Apr 2010 13:27
SELECT * FROM [MyTable] WHERE ([DueDate] < @DueDateParm) Or (@DueDateParm Is Null) "SMXBob" <smxbob(a)seametrix.com> wrote in message news:#PsWTZX3KHA.1660(a)TK2MSFTNGP04.phx.gbl... > Please notice what I am trying to do here. > > If I set the DueDateParm to a date I get all the records less then that > date (see my query). > The result set does NOT include nulls which is how it is suppose to work. > > What I then want is the option to return all rows including nulls. > The OR option would work but I am back to my initial problem how do I > remove it when I want just my date selection. > > > > "SMXBob" <smxbob(a)seametrix.com> wrote in message > news:%23w5bugS3KHA.4332(a)TK2MSFTNGP02.phx.gbl... >>I have a slight problem resetting a date select parameter in that I can't >>get the records with null dates. >> For instance this select statement >> >> SelectCommand="SELECT * FROM [MyTable] WHERE ([DueDate] < @DueDateParm)" >> >> <asp:SessionParameter >> Name="DueDateParm" >> SessionField="DueDateParm" >> DefaultValue="" >> ConvertEmptyStringToNull="true" >> DbType="DateTime" /> >> >> If I set DueDateParm to a date it works fine I get all of the recors less >> than that date. But I can't figure out how to reset it so every record >> comes back.Records with Null dates are not selected. >> The only method I can find is Clear but it clears ALL parameters. I just >> want to reset this one. |