Greetings to all . . . I have a SQL problem.
I have an SQL database that saves the date of the current entry as a standart VarChar. The format is yyyy-mm-dd
What I want to do is to extract the current date from the server, and search for the items that have been added to the database in the past 7 days.
Question 1: I can extract the time and date from the server, and can get it formated to the correct current date, but how do I take into account the change in month on the date. For example . . . If the current date is 2004-07-02, I need everything from 2004-06-26 to 2004-07-02. Does Perl have a built in way of subtracting days?
Question 2: Is there an easy Select statement that will select all the records between those date? (Keep in mind that the date column is NOT set up as a date, but as a VarChar?)
Any help would be great!!
Thanks
The Youthman
I have an SQL database that saves the date of the current entry as a standart VarChar. The format is yyyy-mm-dd
What I want to do is to extract the current date from the server, and search for the items that have been added to the database in the past 7 days.
Question 1: I can extract the time and date from the server, and can get it formated to the correct current date, but how do I take into account the change in month on the date. For example . . . If the current date is 2004-07-02, I need everything from 2004-06-26 to 2004-07-02. Does Perl have a built in way of subtracting days?
Question 2: Is there an easy Select statement that will select all the records between those date? (Keep in mind that the date column is NOT set up as a date, but as a VarChar?)
Any help would be great!!
Thanks
The Youthman