March 22, 2014 at 10:37 pm
Hi All,
Need your help on getting the sql query for the below data
EMP ID Flag Processing Date
ABC1 yes Current Date
ABC1 No Old Date
DEF1 Yes Current Date
DEF1 No Old Date
GHI1 Yes Old Date
JKL1 yes Current Date
JKL1 No Old Date
i need to select only EMP ID for the above table for which Flag is set to Yes and Processing Date is old Date.
Thank you
Santosh
March 22, 2014 at 11:52 pm
santuraj12 (3/22/2014)
Hi All,Need your help on getting the sql query for the below data
EMP ID Flag Processing Date
ABC1 yes Current Date
ABC1 No Old Date
DEF1 Yes Current Date
DEF1 No Old Date
GHI1 Yes Old Date
JKL1 yes Current Date
JKL1 No Old Date
i need to select only EMP ID for the above table for which Flag is set to Yes and Processing Date is old Date.
Thank you
Santosh
Just add mostly what you said the a WHERE clause.
--Jeff Moden
Change is inevitable... Change for the better is not.
March 24, 2014 at 9:08 am
Jeff Moden (3/22/2014)
santuraj12 (3/22/2014)
Hi All,Need your help on getting the sql query for the below data
EMP ID Flag Processing Date
ABC1 yes Current Date
ABC1 No Old Date
DEF1 Yes Current Date
DEF1 No Old Date
GHI1 Yes Old Date
JKL1 yes Current Date
JKL1 No Old Date
i need to select only EMP ID for the above table for which Flag is set to Yes and Processing Date is old Date.
Thank you
Santosh
Just add mostly what you said the a WHERE clause.
And you might have to match the date format for GETDATE() to what is in your table.
But I would question the actual design.
What updates Current Date?
If you wait a day, what happens?
March 26, 2014 at 12:51 am
Select Emp_ID from table_Name where Flag='yes' and processing_date='Old Date'
March 26, 2014 at 12:53 am
Select Emp_ID from table_Name where Flag='yes' and Processing_Date='Old Date'
April 25, 2014 at 8:29 am
select empid from tablename where flag='yes' and processingdate='old date'
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply