Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
hi all

in my organizer program (with csharp and access)

Question 1 :
i have a table in access with this structure :

work_name ---- for my work name
work_date ---- date that i shoud do work
work_time ---- time that i shoud do work
work_alarm --- day number that i get Warning or alarm

for example :

i want go to univercity in 2013/5/12 in time 15:30 and i want get alarm in 3 days before this work

i save this to table like below :
work_name = go to univercity
work_date = 2013/5/12
work_time = 13:30
work_alarm = 3


now Suppose i have a 500 record that any one have a different date and time ....

i want a selet that do below porpuse :
warning or alarm for all work According to
1-current date (system date)
2-work_date
3-work alarm



Question 2 :
i not found any stored procedure or query whit input and output parameter in access
how do i prevent when insert a record ?

thanks a lot
Posted

1 solution

Personally, I wouldn't do it that way: I would probably store it as a pair of DateTime objects:
Work_Date and Alarm_date - and set the Alarm date based on the selected time interval when the user inserts it. That way, the database doesn't need to know what range of intervals your application is interested in - 15 minutes is the same as 7 days to the database. In addition, the calculation is made once, and in "human time" when the appointment is set up. With your scheme the alarm time has to be calculated each time you want to check it.

In your application, you just read out all appointments due in the next hour (say) with a simple SQL every half hour, and you get a list of alarms you should respond to straight away.

Question 2 makes no sense whatsoever to me, so I can't even begin to answer it.

BTW: Have you annoyed someone? Your questions appear to have been down voted en bloc.
 
Share this answer
 
Comments
Maciej Los 7-May-13 16:31pm    
+5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900