O Orfeas Registered User. Local time Today, 12:00 Joined Mar 1, 2005 Messages 11 Mar 1, 2005 #1 Hi I need help. I have an update query and I want to calculate total cost. Total cost equals cost_per_day(curency) times (date_returned - date_hired). =[copy]![cost_per_day] * ??????? How am I supposed to do that?
Hi I need help. I have an update query and I want to calculate total cost. Total cost equals cost_per_day(curency) times (date_returned - date_hired). =[copy]![cost_per_day] * ??????? How am I supposed to do that?
Brianwarnock Retired Local time Today, 12:00 Joined Jun 2, 2003 Messages 12,701 Mar 1, 2005 #2 I guess that you are looking for the DateDiff function to give you the number of days, its in access help. brian
I guess that you are looking for the DateDiff function to give you the number of days, its in access help. brian
O Orfeas Registered User. Local time Today, 12:00 Joined Mar 1, 2005 Messages 11 Mar 1, 2005 #3 i tried this but it does not giving me a result
Brianwarnock Retired Local time Today, 12:00 Joined Jun 2, 2003 Messages 12,701 Mar 1, 2005 #4 I thinkmthat you are going to have to give us a bit more info to work with, like your code, but 1st as this is an update query can I ask that you are running it, not just clicking view? Brian
I thinkmthat you are going to have to give us a bit more info to work with, like your code, but 1st as this is an update query can I ask that you are running it, not just clicking view? Brian
O Orfeas Registered User. Local time Today, 12:00 Joined Mar 1, 2005 Messages 11 Mar 1, 2005 #5 DateDiff("d",Now(),DATE_HIRED)*COPY!COST_PER_DAY THIS IS INSIDE THE UPDATE TO... BUT I DON'T GET ANYTHING I AM RUNNING IT...
DateDiff("d",Now(),DATE_HIRED)*COPY!COST_PER_DAY THIS IS INSIDE THE UPDATE TO... BUT I DON'T GET ANYTHING I AM RUNNING IT...
Brianwarnock Retired Local time Today, 12:00 Joined Jun 2, 2003 Messages 12,701 Mar 1, 2005 #6 Orfeas said: DateDiff("d",Now(),DATE_HIRED)*COPY!COST_PER_DAY THIS IS INSIDE THE UPDATE TO... BUT I DON'T GET ANYTHING I AM RUNNING IT... Click to expand... You don't need to shout I am only trying to help. I knocked up a simple test and mine works, so I am now at a loss, my code did incude the[] round field names, the SQL is below UPDATE Table1 SET Table1.difference = DateDiff("d",Now(),[date2])*[table1]![cost]; Brian
Orfeas said: DateDiff("d",Now(),DATE_HIRED)*COPY!COST_PER_DAY THIS IS INSIDE THE UPDATE TO... BUT I DON'T GET ANYTHING I AM RUNNING IT... Click to expand... You don't need to shout I am only trying to help. I knocked up a simple test and mine works, so I am now at a loss, my code did incude the[] round field names, the SQL is below UPDATE Table1 SET Table1.difference = DateDiff("d",Now(),[date2])*[table1]![cost]; Brian
O Orfeas Registered User. Local time Today, 12:00 Joined Mar 1, 2005 Messages 11 Mar 1, 2005 #7 sorry man I had caps lock on by mistake! Sorry!
Brianwarnock Retired Local time Today, 12:00 Joined Jun 2, 2003 Messages 12,701 Mar 1, 2005 #8 OK If you still have no joy perhaps you could post your db or part of it. Got go now back in 30 mins. the reason i asked about run as oppossed to view is that the update does not rake place for the view it just lists the current field contents. Brian
OK If you still have no joy perhaps you could post your db or part of it. Got go now back in 30 mins. the reason i asked about run as oppossed to view is that the update does not rake place for the view it just lists the current field contents. Brian