set datetime parameter to NULL/not NULL based on another string parameter

  • I have 3 report parameters. The first one is a string datatype called Search_Type with values of All, Open, Resolve, Close. The default value is All.

    I have 2 datetime parameters with "allow NULL value" checked. The defalut value is NULL.

    Is it possible when Search_Type parameter is change to any value other than All, that the datetime parameter's NULL checkbox gets unchecked to force the user to enter in a datetime. And if All is selected, the NULL checkbox gets checked.

  • ????????

  • There might be a way to do that in the report, but why not just handle it in the query? That would be much easier.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • GSquared (3/16/2010)


    There might be a way to do that in the report, but why not just handle it in the query? That would be much easier.

    Please explain how I would handle it in the query....

  • Where @SearchType = 'All' and MyDateColumn between @StartDate and @EndDate or @SearchType != 'All' and ...

    Have something like that in the Where clause.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • GSquared (3/17/2010)


    Where @SearchType = 'All' and MyDateColumn between @StartDate and @EndDate or @SearchType != 'All' and ...

    Have something like that in the Where clause.

    I already have that in my WHERE clause. What I dont want is to force the user to select a date range when SearchType = All.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply