Sunday, March 11, 2012

Another query problem

I am using Dreamweaver for the following:
Hi,
I have a problem with a search/results page, one of the fields is a date, I
want to display all results if the date is not entered in the search page
and display the records that match the date entered if any.
My problem is that if in the results page recordset I enter:
Lastworked = 'MMColParam7'
and I enter MMColParam7 01/01/1950 Request("Date")
Then the result is that if the date is entered I DO get the correct results,
but if the date is not entered I don't get any results at all becasue it
takes 01/01/1950 as default date.
Then I try to use
Lastworked LIKE 'MMColParam7'
and I enter MMColParam7 % Request("Date")
Then If i enter the date I get NO results, even where there are records that
match.
Any ideas ?
ACould you enter more info... Like the table structures of the two SQL tables
you are referring to, and the exact SQL Query you are sending to the databas
e
that is producing "incorrect" results? Some parts of Your post, specificall
y
Lastworked = 'MMColParam7'
are confusing. Lastworked sounds like a name for a column with dates in it,
but 'MMColParam7' is a string, not a date, and IT sopunds like the name for
another column...
"Aleks" wrote:

> I am using Dreamweaver for the following:
> Hi,
> I have a problem with a search/results page, one of the fields is a date,
I
> want to display all results if the date is not entered in the search page
> and display the records that match the date entered if any.
> My problem is that if in the results page recordset I enter:
> Lastworked = 'MMColParam7'
> and I enter MMColParam7 01/01/1950 Request("Date")
> Then the result is that if the date is entered I DO get the correct result
s,
> but if the date is not entered I don't get any results at all becasue it
> takes 01/01/1950 as default date.
>
> Then I try to use
> Lastworked LIKE 'MMColParam7'
> and I enter MMColParam7 % Request("Date")
> Then If i enter the date I get NO results, even where there are records th
at
> match.
> Any ideas ?
>
> A
>
>

No comments:

Post a Comment