SQL current month and next month
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.
Code:
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.
Re: SQL current month and next month
Quote:
Originally Posted by azrina
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.
Code:
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.
Please read this article CAREFULLY: http://vbforums.com/showthread.php?t=333942
Re: SQL current month and next month
Hmm..
I am using MS Access 2003.
Language Used: ASP
Connection Method: ADODB
Re: SQL current month and next month
Quote:
Originally Posted by azrina
Hmm..
I am using MS Access 2003.
Language Used: ASP
Connection Method: ADODB
Tha makes it easier to help ;)
Put this in the WHERE clause
Code:
DateColumn between dateadd(""d"",-day(date())+1,date()) and
dateadd(""m"",1,dateadd(""d"",-day(date())+5,date()))