Ok, I've looked through this forum and can't find what I really need so I'm asking for help. Below is my query...what I want to do is change the date format, currently it's in mm/dd/yyyy but I need it in yyyymm. BUT I also want to remove the prompt and make this an automatic query that will just get me the date for one month of data...here's the catch. I'm always going to need the last month's data. So we're in March now, I'll need it to be February's data. Any help would be great.
Thanks!
SELECT Count([h09_trac CH].ext_ptid) AS CountOfext_ptid
FROM [h09_trac CH] LEFT JOIN [h09_note CH] ON [h09_trac CH].ext_ptid = [h09_note CH].ext_ptid
WHERE ((([h09_note CH].diagnosis) In ("walk out","lwob","lwobs") Or ([h09_note CH].diagnosis) Like "*left without being seen*" Or ([h09_note CH].diagnosis) Is Null) AND (([h09_trac CH].stat) In ("LWBS","LWOB","LWBT","LWOT","W/O","WO","LWTC")) AND (([h09_trac CH].tri_acuity)<>" ") AND (([h09_trac CH].dat_of_ser) Between [Enter Start Date] And [Enter End Date]));
Thanks!
SELECT Count([h09_trac CH].ext_ptid) AS CountOfext_ptid
FROM [h09_trac CH] LEFT JOIN [h09_note CH] ON [h09_trac CH].ext_ptid = [h09_note CH].ext_ptid
WHERE ((([h09_note CH].diagnosis) In ("walk out","lwob","lwobs") Or ([h09_note CH].diagnosis) Like "*left without being seen*" Or ([h09_note CH].diagnosis) Is Null) AND (([h09_trac CH].stat) In ("LWBS","LWOB","LWBT","LWOT","W/O","WO","LWTC")) AND (([h09_trac CH].tri_acuity)<>" ") AND (([h09_trac CH].dat_of_ser) Between [Enter Start Date] And [Enter End Date]));