Using Data as a Filter

  • Thread starter Thread starter AndreMello
  • Start date Start date
A

AndreMello

I am opening a recordset with an SQL String and one of the filters i
Data
i know there is a peculiar format when you try to use data as a filter
something like

(...) where DataX = " & #data# & " (...)

though that doesn't seem to work, i know its around that

could anybody refresh my mind ?

thank
 
Hi -

Why are you using the # signs? Is Data a date type?

If "data" is of date type, or if it is text type with a date in it, try
this: (...) where DataX = #" & data & "# (...), so that the # signs are
a part of the SQL string text.

If "data" is text, use this: (...) where DataX = '" & data & "' (...),
so that the ' (single quotes) are a part of the SQL string text.

If "data" is numeric, you don't need any delimiters, just use:
(...) where DataX = " & data & " (...)

Hope this helps

John
 
Back
Top