TRACEYMARYLAND
Programmer
I have column that is a datetime
If there is no date the value is set to NULL
So if i pass in no parameters to the @from_date and
@to_date i need to show all records.
If i put in a value then only select those records
I have tried
select
ProdSched.PromiseDate >= @from_date and
ProdSched.PromiseDate <= @to_date
and tried this
and Convert(varchar(8),ProdSched.PromiseDate,112) >=
Convert(varchar(8),@from_date,112)
and Convert(varchar(8),ProdSched.PromiseDate,112) <=
Convert(varchar(8),@to_date,112)
But can't get all records if value is nothing NULL
Any suggestions
If there is no date the value is set to NULL
So if i pass in no parameters to the @from_date and
@to_date i need to show all records.
If i put in a value then only select those records
I have tried
select
ProdSched.PromiseDate >= @from_date and
ProdSched.PromiseDate <= @to_date
and tried this
and Convert(varchar(8),ProdSched.PromiseDate,112) >=
Convert(varchar(8),@from_date,112)
and Convert(varchar(8),ProdSched.PromiseDate,112) <=
Convert(varchar(8),@to_date,112)
But can't get all records if value is nothing NULL
Any suggestions