By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,841 Members | 1,757 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,841 IT Pros & Developers. It's quick & easy.

Datediff

P: 3
I have 3 columns in a table date received and appointment date i'm trying to populate a 3rd column with the datediff anybody any idea how to do this
Oct 12 '06 #1
Share this Question
Share on Google+
4 Replies


100+
P: 143
use this SQL.

SELECT tblAppointment.DateRecd, tblAppointment.AppointmentDate, DateDiff("d",[daterecd],[appointmentdate]) AS DateDifference
FROM tblAppointment;

Gives the difference in days. Change the table and field names to suit.
Oct 12 '06 #2

P: 3
where would i put this so it filled in the third colunm automatically when new data is put into the first two colunms




use this SQL.

SELECT tblAppointment.DateRecd, tblAppointment.AppointmentDate, DateDiff("d",[daterecd],[appointmentdate]) AS DateDifference
FROM tblAppointment;

Gives the difference in days. Change the table and field names to suit.
Oct 16 '06 #3

100+
P: 143
Create an unbound text box on your form. In the On Current event, put this.

Me.txtDifference = DateDiff("d", [DateRecd], [Appointment])

Change the names to suit.
Oct 16 '06 #4

P: 3
Thanks for your help
Oct 17 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.