Query using criteria Like Get_Find?

  • Thread starter Thread starter bmac
  • Start date Start date
B

bmac

I've come across a query someone created and it has criteria pulling dates.
Could someone explain to me this criteria: Like Get_Find

Field : oDate: Format([OccurrendDate],"yyyy-mm-dd"
Criteria: Like Get_FindOccurrenceDate()

thanks
 
Get_FindOccurenceDate() is a custom VBA function that is returning some
string value (assumption on what it is returning)

Like will use the returned value in a comparison against the field.

So if Get_FindOccurenceDate() returned
"1999*" all records for the year 1999 would be returned.
"1999-02*" all records for February of 1999 would be returned
"1999-02-01" all records for February 1, 1999 would be returned
"*-02-*" all records for February of every year in the data would be
returned.
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Excellent!!
Taking it a step further could I use the following criteria this way?

Get_FindOccurrenceDate() & "2007*" or Get_FindOccurrenceDate() & "2008*"


--
bmac


John Spencer said:
Get_FindOccurenceDate() is a custom VBA function that is returning some
string value (assumption on what it is returning)

Like will use the returned value in a comparison against the field.

So if Get_FindOccurenceDate() returned
"1999*" all records for the year 1999 would be returned.
"1999-02*" all records for February of 1999 would be returned
"1999-02-01" all records for February 1, 1999 would be returned
"*-02-*" all records for February of every year in the data would be
returned.
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

bmac said:
I've come across a query someone created and it has criteria pulling
dates.
Could someone explain to me this criteria: Like Get_Find

Field : oDate: Format([OccurrendDate],"yyyy-mm-dd"
Criteria: Like Get_FindOccurrenceDate()

thanks
 
Possibly. But since I have no idea what Get_FindOccurenceDate does or what
it returns, I can't tell if that will give you the data you want or not. I
can tell you that concatenating "2007*" on to the end is probably futile.
The only time that would return any records is if the function returned Null
or a zero-length string. If the function returned anything else you would
always end up with NO records returned based on the criteria.

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

bmac said:
Excellent!!
Taking it a step further could I use the following criteria this way?

Get_FindOccurrenceDate() & "2007*" or Get_FindOccurrenceDate() & "2008*"


--
bmac


John Spencer said:
Get_FindOccurenceDate() is a custom VBA function that is returning some
string value (assumption on what it is returning)

Like will use the returned value in a comparison against the field.

So if Get_FindOccurenceDate() returned
"1999*" all records for the year 1999 would be returned.
"1999-02*" all records for February of 1999 would be returned
"1999-02-01" all records for February 1, 1999 would be returned
"*-02-*" all records for February of every year in the data would be
returned.
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

bmac said:
I've come across a query someone created and it has criteria pulling
dates.
Could someone explain to me this criteria: Like Get_Find

Field : oDate: Format([OccurrendDate],"yyyy-mm-dd"
Criteria: Like Get_FindOccurrenceDate()

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top