View Single Post
  #5 (permalink)  
Old 11-05-03, 10:38
basicmek basicmek is offline
Here to Help and Learn
 
Join Date: Oct 2003
Location: Roanoke, Va
Posts: 445
Smile Re: need to use floor() function in access

Quote:
Originally posted by PC2
I have a datatable in access that has a field that contains date information (called Trade_Date). This date is not truncated so I have hour, minutes and seconds information. I need to make a query from VBA to retrieve data for a specific date so I need a query like

" SELECT Trade_Date,... FROM Table WHERE floor(Trade_Date) = desired Date "

I am using Microsoft.Jet.OLEDB.4.0 as the provider and floor() function is not recognized.
In the help I found that scalar functions like floor() should work since you use {} like:

" SELECT Trade_Date,... FROM Table WHERE {fn floor(Trade_Date)} = desired Date "

but it is still not working.
I also tried to use a pass-through query but It fails (maybe because I am not used with this)

Can someone please help me. I need to use a floor() function but don't know how.
Thanks,
PC2
I'm not all that familiar with care and feeding of Excels objects but if you really want to use the floor function can't you just set a reference to the Excel library? I see it's part of the WorksheetFunction class in the Object Browser. Just reference, declare and instantiate and you should be able to use it.

Gregg
Reply With Quote