Filtering Query Results

S

scott

I'm having problems filtering the queryFileds results in InfoPath.
Basically, I've got two fields that I want to filter search results
by. The most eloquent way would be to throw a where clause in the SQL
query that pulls the data from Access into InfoPath. This seems to
work for one of the fields, but InfoPath complains when I add the
second criteria. So I have two questions:

1. Is there a way to correct the SQL code that I have created?
2. If not, is there a way to filter the query reulsts after the data
hits InfoPath such that it only shows the desired records?

For your reference, I've included the SQL code that works, and then
SQL code that does not work.


Working SQL code:
select [OccurrenceID],[Occurrence Date] as [Occurrence_Date],
[EmployeeUID],[OccurrenceType],[Comments],[Deleted]

from [tblOccurrence] as [tblOccurrence]

where ([Deleted]=0)

order by [EmployeeUID], [Occurrence Date]


Non-Working SQL code:
select [OccurrenceID],[Occurrence Date] as [Occurrence_Date],
[EmployeeUID],[OccurrenceType],[Comments],[Deleted]

from [tblOccurrence] as [tblOccurrence]

where ([Deleted]=0 AND [OccurrenceID],[Occurrence
Date]>dateadd("ww",-26,date()))

order by [EmployeeUID], [Occurrence Date]


Thanks!
Scott
 

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

Top