Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jlaz461
Starting Member
2 Posts |
Posted - 2006-09-03 : 18:15:43
|
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: #Report1PERMIT_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 118 05-04a PSD 2005-07-08 Date Ini completeness 218 05-04a PSD 2005-07-15 Date Ini com app recved 318 05-04a PSD 2005-08-30 Date draft issued 518 05-04a PSD 2005-09-03 Date Pub commment 618 05-04a PSD 2005-11-03 Date final decision issued 719 05-01a PSD 2005-07-14 Date Ini app received 119 05-01a PSD 2005-08-01 Date Ini completeness 219 05-01a PSD 2005-08-05 Date Ini com app recved 319 05-01a PSD 2005-08-08 Date draft issued 519 05-01a PSD 2005-09-21 Date Pub commment 619 05-01a PSD 2005-11-19 Date final decision issued 720 05-04b PSD 2005-08-13 Date Ini app received 120 05-04b PSD 2005-08-21 Date Ini completeness 220 05-04b PSD 2005-09-10 Date Ini com app recved 320 05-04b PSD 2005-09-15 Date draft issued 520 05-04b PSD 2005-10-22 Date Pub commment 620 05-04b PSD Date final decision issued 721 05-06a PSD 2005-06-14 Date Ini app received 121 05-06a PSD 2005-07-09 Date Ini completeness 221 05-06a PSD 2005-07-18 Date Ini com app recved 321 05-06a PSD 2005-08-30 Date draft issued 521 05-06a PSD 2005-09-12 Date Pub commment 621 05-06a PSD 2005-11-15 Date final decision issued 7What 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 118 05-04a PSD 2005-07-08 Date Ini completeness 218 05-04a PSD 2005-07-15 Date Ini com app recved 318 05-04a PSD 2005-08-30 Date draft issued 518 05-04a PSD 2005-09-03 Date Pub commment 618 05-04a PSD 2005-11-03 Date final decision issued 719 05-01a PSD 2005-07-14 Date Ini app received 119 05-01a PSD 2005-08-01 Date Ini completeness 219 05-01a PSD 2005-08-05 Date Ini com app recved 319 05-01a PSD 2005-08-08 Date draft issued 519 05-01a PSD 2005-09-21 Date Pub commment 619 05-01a PSD 2005-11-19 Date final decision issued 721 05-06a PSD 2005-06-14 Date Ini app received 121 05-06a PSD 2005-07-09 Date Ini completeness 221 05-06a PSD 2005-07-18 Date Ini com app recved 321 05-06a PSD 2005-08-30 Date draft issued 521 05-06a PSD 2005-09-12 Date Pub commment 621 05-06a PSD 2005-11-15 Date final decision issued 7Thanks very much for your help Joseph |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-09-03 : 20:11:58
|
Add a conditionwhere PERMIT_EVENT_DT is NOT NULL KH |
|
|
|
|
|