Click to See Complete Forum and Search --> : SQL current month and next month


azrina
04-28-2006, 03:16 AM
Hi all.
I am having problem with SQL syntax.
I want to display data from a table called permohonan.
The conditions are;
1)The field jpk must equal to 1
2)The field sokong must null.
And the other condition is which I dont know how to write in SQL, which is I want to retrieve data from permohonan where the date is 1st day of current month untill 5th day of next month.

Select * from permohonan where jpk = 1 and sokong is null and ....
I really dont have any idea how to do this.
Can SQL capture the current month?
Hope, you can help me.
Thanks in advance.

russell
04-28-2006, 12:50 PM
what dbms?

in mssql it would go like:

And datapart(m, dateField) = datepart(m, current_timestamp)
And datepart(d, dateField) BETWEEN 1 And 5

payalsaxena1504
05-04-2006, 09:04 AM
will it work with SQL in ORACLE also?
thnx!

payalsaxena1504
05-06-2006, 10:14 PM
will it work with SQL in ORACLE also?
thnx!