View previous topic :: View next topic
|
Author |
Message |
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
Hi All,
I have the table in the below format (for eg)
EMPNO DATE SALARY
E1 01-01-2005 1000
E2 01-27-2005 1500
E3 01-28-2005 2000
E4 02-01-2005 2000
E5 02-20-2005 5000
E6 03-01-2005 4500
I need the output as
EMPNO DATE SALARY
E1 01-01-2005 1000
E4 02-01-2005 2000
E6 03-01-2005 4500
Like this.. ie., To Extract a data of every first day for the every month ...
Hope clear.. And i will b helpful for ur earliest response... |
|
Back to top |
|
|
radhakrishnan82
Active User
Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
Try this:
Code: |
SELECT EMPNO,
DATE,
SALARY
FROM EMPTABLE
WHERE
SUBSTR(CHAR(DATE),4,2) = '01'; |
Hope this helps. |
|
Back to top |
|
|
nikyojin
New User
Joined: 05 Oct 2005 Posts: 94
|
|
|
|
Hi Khamarutheen,
Code: |
SELECT EMPNO,
DATE,
SALARY
FROM EMPTABLE
WHERE DAY(DATE)=01; |
Do inform if anything else is required
Regards,
Nikhil .S. |
|
Back to top |
|
|
|