Hi, I need some help with writing the SQL definition necessary to do the following:
(Cut and paste into Notepad to see correct layout)
Temp table name: #Report1
PERMIT_ID PERMIT_NR PERMIT_TYPE_CD PERMIT_EVENT_DT DATE_TYPE_DS DATE_TYPE_CD
------------------------------------------------------------------------------------------------
18 05-04a PSD 2005-06-14 Date Ini app received 1
18 05-04a PSD 2005-07-08 Date Ini completeness 2
18 05-04a PSD 2005-07-15 Date Ini com app recved 3
18 05-04a PSD 2005-08-30 Date draft issued 5
18 05-04a PSD 2005-09-03 Date Pub commment 6
18 05-04a PSD 2005-11-03 Date final decision issued 7
19 05-01a PSD 2005-07-14 Date Ini app received 1
19 05-01a PSD 2005-08-01 Date Ini completeness 2
19 05-01a PSD 2005-08-05 Date Ini com app recved 3
19 05-01a PSD 2005-08-08 Date draft issued 5
19 05-01a PSD 2005-09-21 Date Pub commment 6
19 05-01a PSD 2005-11-19 Date final decision issued 7
20 05-04b PSD 2005-08-13 Date Ini app received 1
20 05-04b PSD 2005-08-21 Date Ini completeness 2
20 05-04b PSD 2005-09-10 Date Ini com app recved 3
20 05-04b PSD 2005-09-15 Date draft issued 5
20 05-04b PSD 2005-10-22 Date Pub commment 6
20 05-04b PSD Date final decision issued 7
21 05-06a PSD 2005-06-14 Date Ini app received 1
21 05-06a PSD 2005-07-09 Date Ini completeness 2
21 05-06a PSD 2005-07-18 Date Ini com app recved 3
21 05-06a PSD 2005-08-30 Date draft issued 5
21 05-06a PSD 2005-09-12 Date Pub commment 6
21 05-06a PSD 2005-11-15 Date final decision issued 7
What I need is a query that will return the data above and leave out those without a PERMIT_EVENT_DT. In other words
the output should be:
PERMIT_ID PERMIT_NR PERMIT_TYPE_CD PERMIT_EVENT_DT DATE_TYPE_DS DATE_TYPE_CD
------------------------------------------------------------------------------------------------
18 05-04a PSD 2005-06-14 Date Ini app received 1
18 05-04a PSD 2005-07-08 Date Ini completeness 2
18 05-04a PSD 2005-07-15 Date Ini com app recved 3
18 05-04a PSD 2005-08-30 Date draft issued 5
18 05-04a PSD 2005-09-03 Date Pub commment 6
18 05-04a PSD 2005-11-03 Date final decision issued 7
19 05-01a PSD 2005-07-14 Date Ini app received 1
19 05-01a PSD 2005-08-01 Date Ini completeness 2
19 05-01a PSD 2005-08-05 Date Ini com app recved 3
19 05-01a PSD 2005-08-08 Date draft issued 5
19 05-01a PSD 2005-09-21 Date Pub commment 6
19 05-01a PSD 2005-11-19 Date final decision issued 7
21 05-06a PSD 2005-06-14 Date Ini app received 1
21 05-06a PSD 2005-07-09 Date Ini completeness 2
21 05-06a PSD 2005-07-18 Date Ini com app recved 3
21 05-06a PSD 2005-08-30 Date draft issued 5
21 05-06a PSD 2005-09-12 Date Pub commment 6
21 05-06a PSD 2005-11-15 Date final decision issued 7
Thanks very much for your help
Joseph
(Cut and paste into Notepad to see correct layout)
Temp table name: #Report1
PERMIT_ID PERMIT_NR PERMIT_TYPE_CD PERMIT_EVENT_DT DATE_TYPE_DS DATE_TYPE_CD
------------------------------------------------------------------------------------------------
18 05-04a PSD 2005-06-14 Date Ini app received 1
18 05-04a PSD 2005-07-08 Date Ini completeness 2
18 05-04a PSD 2005-07-15 Date Ini com app recved 3
18 05-04a PSD 2005-08-30 Date draft issued 5
18 05-04a PSD 2005-09-03 Date Pub commment 6
18 05-04a PSD 2005-11-03 Date final decision issued 7
19 05-01a PSD 2005-07-14 Date Ini app received 1
19 05-01a PSD 2005-08-01 Date Ini completeness 2
19 05-01a PSD 2005-08-05 Date Ini com app recved 3
19 05-01a PSD 2005-08-08 Date draft issued 5
19 05-01a PSD 2005-09-21 Date Pub commment 6
19 05-01a PSD 2005-11-19 Date final decision issued 7
20 05-04b PSD 2005-08-13 Date Ini app received 1
20 05-04b PSD 2005-08-21 Date Ini completeness 2
20 05-04b PSD 2005-09-10 Date Ini com app recved 3
20 05-04b PSD 2005-09-15 Date draft issued 5
20 05-04b PSD 2005-10-22 Date Pub commment 6
20 05-04b PSD Date final decision issued 7
21 05-06a PSD 2005-06-14 Date Ini app received 1
21 05-06a PSD 2005-07-09 Date Ini completeness 2
21 05-06a PSD 2005-07-18 Date Ini com app recved 3
21 05-06a PSD 2005-08-30 Date draft issued 5
21 05-06a PSD 2005-09-12 Date Pub commment 6
21 05-06a PSD 2005-11-15 Date final decision issued 7
What I need is a query that will return the data above and leave out those without a PERMIT_EVENT_DT. In other words
the output should be:
PERMIT_ID PERMIT_NR PERMIT_TYPE_CD PERMIT_EVENT_DT DATE_TYPE_DS DATE_TYPE_CD
------------------------------------------------------------------------------------------------
18 05-04a PSD 2005-06-14 Date Ini app received 1
18 05-04a PSD 2005-07-08 Date Ini completeness 2
18 05-04a PSD 2005-07-15 Date Ini com app recved 3
18 05-04a PSD 2005-08-30 Date draft issued 5
18 05-04a PSD 2005-09-03 Date Pub commment 6
18 05-04a PSD 2005-11-03 Date final decision issued 7
19 05-01a PSD 2005-07-14 Date Ini app received 1
19 05-01a PSD 2005-08-01 Date Ini completeness 2
19 05-01a PSD 2005-08-05 Date Ini com app recved 3
19 05-01a PSD 2005-08-08 Date draft issued 5
19 05-01a PSD 2005-09-21 Date Pub commment 6
19 05-01a PSD 2005-11-19 Date final decision issued 7
21 05-06a PSD 2005-06-14 Date Ini app received 1
21 05-06a PSD 2005-07-09 Date Ini completeness 2
21 05-06a PSD 2005-07-18 Date Ini com app recved 3
21 05-06a PSD 2005-08-30 Date draft issued 5
21 05-06a PSD 2005-09-12 Date Pub commment 6
21 05-06a PSD 2005-11-15 Date final decision issued 7
Thanks very much for your help
Joseph