Solved

Reporting..

Posted on 2001-06-28
6
119 Views
Last Modified: 2010-04-06
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
Comment
Question by:systemop
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6234426
?
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 6234476
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
 

Author Comment

by:systemop
ID: 6234537
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 4

Accepted Solution

by:
YodaMage earned 100 total points
ID: 6234830
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
 

Author Comment

by:systemop
ID: 6234875
Thank you man i created what i wanted. Your comment is helpful
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6236924
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now