Any Idea how can I identify if there is new client added on my database.
I was thinking about identifying it thru date_added field.
id client_name date_added
---------------------------------
1 ABC 2013-01-02
2 XYZ 2013-01-03
3 EFG 2013-01-02
4 HIJ 2013-01-05
as you can see a new client added HIJ on 2013-01-05.
I was looking with this kind of result:
Client List
Total NO: 4
New Client
Total No: 1
Client Name: HIJ
It's hard to tell but based on your comment ...my reference date is 1 month interval... you might be looking for something like this
Obviously you can easily change
CURDATE()
with any other reference date in the past in this query and you get results for that date.Lets assume that you have following sample data
and today is
2013-08-13
then the output from the query will be