Append Query

brucey54

Registered User.
Local time
Today, 13:33
Joined
Jun 18, 2012
Messages
155
Hi folks, how do you take a date from a textbox on a form into an Append query and increase the date entered into the textbox by 1 day.


i.e. 26/11/2013 to append the date as 27/11/2013

This is what I have so far but not working??


Append Query


MealDate: [Forms]![FrmSwitchBoard]![txtweekend]=DateAdd("d",1,Date())
 
Please show the sql for the append query you have.

Are you changing the value of a field in a table, or are you trying to change the display in the textbox?

Tell us in plain English WHAT you want to accomplish.
 
I am trying to append data to a table with a date from a textbox on a form and have the append query increment the date field by 1 day i.e. DateAdd("d",1,Date())

INSERT INTO TblDietPlan ( ClientID, MealDate, MorningSnack, AfternoonSnack, EveningSnack )

SELECT DISTINCT TblDietPlan.ClientID, [Forms]![FrmSwitchBoard]![txtweekend]=DateAdd("d",1,Date()) AS Expr1, TblDietPlan.MorningSnack, TblDietPlan.AfternoonSnack, TblDietPlan.EveningSnack

FROM TblClient INNER JOIN TblDietPlan ON TblClient.ClientID = TblDietPlan.ClientID;
 
Is this what you are looking for?
Code:
INSERT INTO TblDietPlan ( ClientID, MealDate, MorningSnack, AfternoonSnack, EveningSnack )
SELECT DISTINCT TblDietPlan.ClientID, [COLOR=Red][B]DateAdd("d", 1, [COLOR=Blue][Forms]![FrmSwitchBoard]![txtweekend][/COLOR])[/B][/COLOR] AS Expr1, TblDietPlan.MorningSnack, TblDietPlan.AfternoonSnack, TblDietPlan.EveningSnack
FROM TblClient INNER JOIN TblDietPlan ON TblClient.ClientID = TblDietPlan.ClientID;
 

Users who are viewing this thread

Back
Top Bottom