Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date parameter choices

Status
Not open for further replies.

sandeep2013

IS-IT--Management
Jun 26, 2013
4
US
I have two sets of date parameters each has a from and to. If they chose 1 date parameter they do not need to pick the other and vica versa.

process date from/process date to
Claim Live Service Date From/Claim Live Service Date to.

Can i do this in the command in my SQL statment?
 
I don't have access to any way of testing this and it will almost certainly depend on the database you are using anyway, but I am not aware of any way to deal with null parameters within a Command.

Rather than having 2 date range parameters , I would have a single date range parameter set and a parameter indicating which date to apply it to.

The Where statement in your Command would then look something like this (bearing in mmind that the actual SQL will depend on the database you are querying):

Code:
Where	(
		(	
			{?DateType} = "PROCESS" and
			Table.ProcessDate between {?StartDate} and {?EndDate}
		)
		OR
		(	
			{?DateType} = "LIVE" and
			Table.ClaimLiveDate between {?StartDate} and {?EndDate}
		)
	)
 
Another method is to give each parameter a default date like 1/1/1957, assuming that this can never be a valid value.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top