Hi all,
I need some help with a sql query I am trying to do.
I had a sheet which I copied from excel.
Currently the columns which I have are Name, Phone, W1, W2, W3, W4, W5, W6, W7.
These W columns contain dates in each of them (as Strings).
The query I want to do is to Select a Name and W cell for each person that has a 09 (ie. September) in any of the W columns. I am able to do this using the following code:
SELECT Adults.NAME, W1, W2, W3, W4, W5, W6, W7
FROM Adults
WHERE (((Adults.W1) Like '*09/*')) OR (((Adults.W2) Like '*09/*')) OR (((Adults.W3) Like '*09/*')) OR (((Adults.W4) Like '*09/*')) OR (((Adults.W5) Like '*09/*')) OR (((Adults.W6) Like '*09/*')) OR (((Adults.W7) Like '*09/*'));
However, what I want my output to show is ONLY the September date. Right now it shows all of the other dates associated with the person. I know I get all of this extra output because my SELECT line states W1 ... W7 - but I am not sure how to change my code to result only the September stuff.
I know it sounds a bit confusing, but any help would be MUCH appreciated.
thanks
I need some help with a sql query I am trying to do.
I had a sheet which I copied from excel.
Currently the columns which I have are Name, Phone, W1, W2, W3, W4, W5, W6, W7.
These W columns contain dates in each of them (as Strings).
The query I want to do is to Select a Name and W cell for each person that has a 09 (ie. September) in any of the W columns. I am able to do this using the following code:
SELECT Adults.NAME, W1, W2, W3, W4, W5, W6, W7
FROM Adults
WHERE (((Adults.W1) Like '*09/*')) OR (((Adults.W2) Like '*09/*')) OR (((Adults.W3) Like '*09/*')) OR (((Adults.W4) Like '*09/*')) OR (((Adults.W5) Like '*09/*')) OR (((Adults.W6) Like '*09/*')) OR (((Adults.W7) Like '*09/*'));
However, what I want my output to show is ONLY the September date. Right now it shows all of the other dates associated with the person. I know I get all of this extra output because my SELECT line states W1 ... W7 - but I am not sure how to change my code to result only the September stuff.
I know it sounds a bit confusing, but any help would be MUCH appreciated.
thanks
Comment