Solved

Reporting..

Posted on 2001-06-28
6
122 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
When I am typing into a TEdit last word repeats 7 145
Delphi: making a BW image transparent 10 57
Delphi: sending SMS on android platform 1 32
shape, triangle, dbctrlgrid 3 17
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 shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

808 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