Date Equivelant of this line?

Ice Rhino

Registered User.
Local time
Today, 05:31
Joined
Jun 30, 2000
Messages
210
I have various fields on a form that are referenced by various different queries. The one that is causing me the most problems is the one that contains Date content

On most of the other fields I use something similar to

Like "*" & [Forms]![frmarchivesearch]![txtinvCustname] & "*"

However when it comes to searching to search for dates this format of line does not appear to work. Is that because '*' is present and it is expecting something similar to #. e.g. is the '*' text related wild card?

If so, what is the solution to the above line where if nothing is present in the box search for everything within that particular date field, however if there is a value that is not null then search for that.

Regards in advance
 
Hmm I just tried what you coded and it works for me :confused: perhaps the error is more obscure than your logic.

Brian
 
Yeah maybe. I will revisit it and see what I screwed up

Thanks
 
In the query design grid:

[Forms]![MyForm]![MyControl] OR [Forms]![MyForm]![MyControl] Is Null

There is not date equivalint of the text wildcard. That would be silly.
 
Didn't get on the forum yesterday so this is delayed.

It may seem silly but it works.
In addition if the control on the form is a text format what actually happens if my tests are to be believed is that the date string gets treated as a text string when you use "like" and thus you can use wild cards

EG using the above criteria you could enter on the form /06/ and assuming sensible English date format select all June dates, you can even use ? of course care is needed as 03 would select all dates with day month part of year or time with 03 .

If the above is rubbish please tell me I won't be offended but will revisit my tests to see what I did wrong

Brian
 
Yeah Brian, what a load of old rubbish. God you don't half go on and on and on.

Only kidding. I revisted my query and form and it 'seems' 0K now, although I am not really sure why. Maybe it was just one of those days where even ABC123 is complicated

Thanks for your comments.

Kindest Regards
 
Ice Rhino said:
Yeah Brian, what a load of old rubbish. God you don't half go on and on and on.

Only kidding. I revisted my query and form and it 'seems' 0K now, although I am not really sure why. Maybe it was just one of those days where even ABC123 is complicated

Thanks for your comments.

Kindest Regards

:D :D :D

Glad it's all OK, damned contrary these computers

brian
 

Users who are viewing this thread

Back
Top Bottom