Latest Lists

How do I build a query in MS Access with multiple criteria?

I'm trying to build an Access database for something at work and need to base a query on a couple different fields in order to generate work lists. The two fields I'm working with are "City Property" which is a yes/no, and "Date Received" which is a date/time. If it is city property, there will be no date received and if it's not city property, then there will need to be a date received.

Public Comments

  1. I'm not quite sure if you are looking for help with the database or the query. The first question would be if the two fields you need to pull are in the same table or different tables? If they are in the same table then your Query would look like this: Select City_property, Date_received from TABLE where statement order by or group by If they are in two different tables and they have a primary or foreign key in common then use this: Select Table1.City_Property, Table2.Date_Received From Table1 Inner Join Table2 on Table1.key_field = Table2.key_field where statement order by or group by Hope this helps. Good luck!
  2. Assuming both fields are in the same table, this query should provide the required records: Select * From Table Where (([City Property]) Or ((Not [City Property]) And (Not IsNull([Date Received])))); Note: multiple lines are to ensure that Yahoo doesn't truncate the query. ยง
  3. Select 'no' as [prop],[date received] from Tbl1 where [city property]=0 and [date received] is not null union Select 'Yes',[date received] from Tbl1 where [city property]<>0
Powered by Yahoo! Answers