Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 129
  • Last Modified:

Reporting..

I want to add dates to my database and want to warn user 1 week before the date comes when i open my program. And i want to give detailed report to users that they enters tha date ex: 5.07.2001 and it gives the dates that before from this from database..
0
systemop
Asked:
systemop
1 Solution
 
kretzschmarCommented:
?
0
 
TheNeilCommented:
And? You just need to get your code to check the database everytime it gets opened (and at regular intervals, say every hour). Setup a query to extract the dates in the range that you want and then react to any items that fall inside your criteria (informing the user as need be)

The Neil =:)
0
 
systemopAuthor Commented:
Example :

i add two dates to database 1.1.1999 and 2.1.1999.
and also two works to this two dates wash car and paint wall

if todays date 30.12.1998 i want to show that 'Warning : after 2 days you will wash your car..' and also 'Warning : after 3 days you will paint your wall.'

Also i want to report all the works DateToStr(Date) - 7

hope explained..
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
YodaMageCommented:
Right off the bat, you don't want DateToStr(Date)-7. Date is an integer value of #days since 12-30-1899 in Delphi. So what you really want is (Date - 7). You can filter data by 'DateField > (Date - 7)' or in the case of SQL use Select * from Table where (datefield > (Date - 7)). Either will essentially give you the proper dataset. Then use a messagedlg with a string like

'Warning :after ' + inttostr(datefield - Date) + ' days you will ' + TaskDesc.AsString + '.',

I believe this is what you are trying to do, if not you should be able to work with this.
0
 
systemopAuthor Commented:
Thank you man i created what i wanted. Your comment is helpful
0
 
kretzschmarCommented:
i would solve this in this way:

you can use a query like
select datefield,todofield from atable where datefield between :start and :end order by datefield
and a code like

query1.close;
query1.parambyname('start').AsDateTime := Trunc(now);
query1.parambyname('end').AsDateTime := Trunc(now+7); //or +8
query1.open;

connect your query to a datasource, the datasource to a grid and use the code maybe in the form OnCreate-Event

meikl ;-)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now