Pass Through Query

  • Thread starter Thread starter Rubie
  • Start date Start date
R

Rubie

Hello,

How do I get a pass through query to pull data from a column that has date
and time in it?

Thanks in advance for your help.
 
hi Rubie,
How do I get a pass through query to pull data from a column that has date
and time in it?
This really depends on your back end as you have to use its SQL dialect.

mfG
--> stefan <--
 
Thank you for responding Stefan. When I was trying to run the query I tried
"Where DateAdded =Now()" but it didn't like that.
 
With MS SQL you would need to use
SELECT *
FROM SomeTable
WHERE DateAdded Between GetDate() and DateAdd('day',1, GetDate())

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
Hi John,
I tried it and got this error message =>Invalid parameter 1 specified for
dateadd. What are your thoughts on that?
Thanks,
 
My error

It should be
DateAdd(day,1,GetDate())

I forget, but I think GetDate returns the current date AND time so you are
going to need to convert that to get just the date portion.

This expression should work, but I'm not sure it is the best expression to do
this.
Convert(DateTime,Convert(VarChar (10),GetDate(), 101))
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top