I've been banging my head on the desk today. The Boss wants a report based on a payments table which includes, 12 date fields.
The query should return data for any record which has a match in any of these fields.
<code>SELECT *
FROM DETAILS
WHERE (((DETAILS.PaymentDate) Like Date())) OR (((DETAILS.PaymentDate1) Like Date())) OR (((DETAILS.PaymentDate2) Like Date())) OR (((DETAILS.PaymentDate3) Like Date())) OR (((DETAILS.PaymentDate4) Like Date())) OR (((DETAILS.PaymentDate5) Like Date())) OR (((DETAILS.PaymentDate6) Like Date())) OR (((DETAILS.PaymentDate7) Like Date())) OR (((DETAILS.PaymentDate8) Like Date())) OR (((DETAILS.PaymentDate9) Like Date())) OR (((DETAILS.PaymentDate10) Like Date())) OR (((DETAILS.PaymentDate11) Like Date()));</code>
I'm not exactly sure where I went wrong. The query returns only one result instead of all results. Thus far, there are only two entries in the DB. One which has a value of 01/01/10 for PaymentDate and one record which includes 01/01/10 for PaymentDate3. Both should appear when this query is run, but for the all the RedBull in Manhatten, I can't get this to work. It has to be something terribly simple.
The columns are all the same, Date with a Short Date Format. I've tried many variations of the above with no success. The query seems to pull data from the first column but proceeds no further.
Oh great gurus of MS ACCESS, hear my plea and lend aid to this troubled tech.
The query should return data for any record which has a match in any of these fields.
<code>SELECT *
FROM DETAILS
WHERE (((DETAILS.PaymentDate) Like Date())) OR (((DETAILS.PaymentDate1) Like Date())) OR (((DETAILS.PaymentDate2) Like Date())) OR (((DETAILS.PaymentDate3) Like Date())) OR (((DETAILS.PaymentDate4) Like Date())) OR (((DETAILS.PaymentDate5) Like Date())) OR (((DETAILS.PaymentDate6) Like Date())) OR (((DETAILS.PaymentDate7) Like Date())) OR (((DETAILS.PaymentDate8) Like Date())) OR (((DETAILS.PaymentDate9) Like Date())) OR (((DETAILS.PaymentDate10) Like Date())) OR (((DETAILS.PaymentDate11) Like Date()));</code>
I'm not exactly sure where I went wrong. The query returns only one result instead of all results. Thus far, there are only two entries in the DB. One which has a value of 01/01/10 for PaymentDate and one record which includes 01/01/10 for PaymentDate3. Both should appear when this query is run, but for the all the RedBull in Manhatten, I can't get this to work. It has to be something terribly simple.
The columns are all the same, Date with a Short Date Format. I've tried many variations of the above with no success. The query seems to pull data from the first column but proceeds no further.
Oh great gurus of MS ACCESS, hear my plea and lend aid to this troubled tech.