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 |
Yonkouturko
Yak Posting Veteran
59 Posts |
Posted - 2012-12-04 : 02:45:44
|
i'm experimenting in SQL Select statementsI have this code"SELECT RecordID, JobOrder#, RequestBy, Transactions, Description, Remarks, Status, Date_Scheduled, StartDate, StartTime, EndDate, EndTime, DR#, PO#, OR#, SI#, AmountFROM tblMonitoringWHERE (Employee = @EMP) AND(Status = 'On-Hand' OR Status = 'Update')UNION ALLSELECT RecordID, JobOrder#, RequestBy, Transactions, Description, Remarks, Status, Date_Scheduled, StartDate, StartTime, EndDate, EndTime, DR#, PO#, OR#, SI#, AmountFROM tblMonitoringWHERE (StartDate = @DATE) AND ( (Employee = @EMP) AND (Status <> 'Finished' OR Status <> 'Cancelled' OR Status <> 'Failed'))ORDER BY StartDate DESC"and im getting redundant Lines in my viewbut my entry in dbase is just single...and its view has redundant... can someone help me with this... |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2012-12-04 : 02:48:07
|
Use UNION instead of UNION ALL--Chandu |
|
|
Yonkouturko
Yak Posting Veteran
59 Posts |
Posted - 2012-12-04 : 02:49:50
|
tnx bandi ill give it a try! |
|
|
Yonkouturko
Yak Posting Veteran
59 Posts |
Posted - 2012-12-04 : 02:51:32
|
it worked perfectly thank you for your help!!! bandi |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2012-12-04 : 03:25:48
|
quote: Originally posted by Yonkouturko it worked perfectly thank you for your help!!! bandi
Welcome--Chandu |
|
|
|
|
|
|
|