If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
like operator
i'm learning more about queries and understand how to use text as part of a
phrase using * and how to use like operator and using [ ] to prompt for input. is there anyway to combine it? what i wanted to attempt is to prompt for input, and use like operator to find whatever what put in in that field. for example, if i have a date/time field (unfortunately both are in the same field) i want to prompt for the date, but query everything that it contains. so if the field is 5/5/2005 12:00:00 i want to be able to just type 5/5/2005 when running the query and show all records that contain that text, no matter what time follows it. is this possible? or is there a way to get around it? tia |
#2
|
|||
|
|||
Try the Format function....Format(fieldname, "Short Date")...look up the
format function in your module help section. "seth" wrote: i'm learning more about queries and understand how to use text as part of a phrase using * and how to use like operator and using [ ] to prompt for input. is there anyway to combine it? what i wanted to attempt is to prompt for input, and use like operator to find whatever what put in in that field. for example, if i have a date/time field (unfortunately both are in the same field) i want to prompt for the date, but query everything that it contains. so if the field is 5/5/2005 12:00:00 i want to be able to just type 5/5/2005 when running the query and show all records that contain that text, no matter what time follows it. is this possible? or is there a way to get around it? tia |
#3
|
|||
|
|||
On Thu, 5 May 2005 12:25:02 -0400, "seth" wrote:
i'm learning more about queries and understand how to use text as part of a phrase using * and how to use like operator and using [ ] to prompt for input. is there anyway to combine it? what i wanted to attempt is to prompt for input, and use like operator to find whatever what put in in that field. Use LIKE "*" & [Enter term:] & "*" on the criteria line. for example, if i have a date/time field (unfortunately both are in the same field) i want to prompt for the date, but query everything that it contains. so if the field is 5/5/2005 12:00:00 i want to be able to just type 5/5/2005 when running the query and show all records that contain that text, no matter what time follows it. The above advice applies to TEXT fields (it's still useful there though so I'm leaving it in!) but a date/time field *IS NOT TEXT*. Internally, it's stored as a Double Float count of days and fractions of a day (times) since midnight, December 30, 1899. To get all records for a given day, regardless of the time, you can use a criterion = [Enter date:] AND DateAdd("d", 1, [Enter date:]) Access will only prompt you once if the parameter is exactly the same in both instances. John W. Vinson[MVP] |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
like operator | seth | General Discussion | 2 | May 5th, 2005 07:32 PM |
How to make the Operator a Variable? | CaptainMyCaptain | Running & Setting Up Queries | 1 | October 20th, 2004 03:05 PM |
In operator question | Tony | Running & Setting Up Queries | 3 | September 22nd, 2004 03:57 AM |
Missing Operator Problem | Benjamin | Running & Setting Up Queries | 4 | August 26th, 2004 01:34 PM |
me operator | Marc | Worksheet Functions | 4 | March 18th, 2004 12:27 PM |