proudestWarehouse89
proudestWarehouse89

Reputation: 19

Querying a pass through query Acess

I'm looking how to run a local query with date filters on a saved pass-through queries in Access. I'm trying to leverage the pass through query as basically a View in my Access database... the local query is constructed dynamically in VBA, and intended to be a clean way to filter my pass through query. I'd like to avoid creating another pass through query, or altering the original, every time i run my Sub Procedure.

My problem is that the normal access date filter format #m/d/yyyy# doesn't seem to work. I've tried both altering the date format as well in the pass through query with 1. Convert(varchar(12),p.startDate,101); 2. Convert(date,p.StartDate,101); but neither will work when the pass through query is queried against locally.

Does anyone know how to do this?

UPDATE - I just checked and Access is reading the field as Text... does anyone know how it can read it as a date? As i mentioned the CONVERT functions don't seem to be working to do this

Upvotes: 1

Views: 1008

Answers (1)

iDevlop
iDevlop

Reputation: 25262

In a passthru you MUST use the backend's syntax. If the BE is SQL Server then I'd use a syntax like this:

WHERE DocDate = '2015-03-17'

Upvotes: 1

Related Questions