Solved

Reporting..

Posted on 2001-06-28
6
125 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

710 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