Solved

Reporting..

Posted on 2001-06-28
6
120 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

910 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

25 Experts available now in Live!

Get 1:1 Help Now