Adding Values in Query

  • Thread starter Thread starter vikash.verma
  • Start date Start date
V

vikash.verma

Hi
I have written a query in which i have Date picket vale being passed.
Eg


SELECT DelDetl.CustomerID, FROM Customer WHERE (((DelDetl.StartDate) Between ([Forms]![Forms_WeeklyFuelReport]![DTPickerSD_StartDate].[Value]) And ([Forms]![Forms_WeeklyFuelReport]![DTPickerSD_StartDate].[Value] + 6)))

Now i want to add 6 to my Date but the Query analyser in Ms Access throws an Error.If i remove 6 i get a perfect output.

What should i do to add some numeric value to the DATE.

Help needed for you all

Regards
Vikash
 
Try:
Where DelDetl.StartDate Between [Forms]![Forms_WeeklyFuelReport]![DTPickerSD_StartDate] And DateAdd("d",6,[Forms]![Forms_WeeklyFuelReport]![DTPickerSD_StartDate])


--
Duane Hookom
MS Access MVP


Hi
I have written a query in which i have Date picket vale being passed.
Eg


SELECT DelDetl.CustomerID, FROM Customer WHERE (((DelDetl.StartDate) Between ([Forms]![Forms_WeeklyFuelReport]![DTPickerSD_StartDate].[Value]) And ([Forms]![Forms_WeeklyFuelReport]![DTPickerSD_StartDate].[Value] + 6)))

Now i want to add 6 to my Date but the Query analyser in Ms Access throws an Error.If i remove 6 i get a perfect output.

What should i do to add some numeric value to the DATE.

Help needed for you all

Regards
Vikash
 
Hi Duane
Thankx It worked

Regards
Vikash
Try:
Where DelDetl.StartDate Between [Forms]![Forms_WeeklyFuelReport]![DTPickerSD_StartDate] And DateAdd("d",6,[Forms]![Forms_WeeklyFuelReport]![DTPickerSD_StartDate])


--
Duane Hookom
MS Access MVP


Hi
I have written a query in which i have Date picket vale being passed.
Eg


SELECT DelDetl.CustomerID, FROM Customer WHERE (((DelDetl.StartDate) Between ([Forms]![Forms_WeeklyFuelReport]![DTPickerSD_StartDate].[Value]) And ([Forms]![Forms_WeeklyFuelReport]![DTPickerSD_StartDate].[Value] + 6)))

Now i want to add 6 to my Date but the Query analyser in Ms Access throws an Error.If i remove 6 i get a perfect output.

What should i do to add some numeric value to the DATE.

Help needed for you all

Regards
Vikash
 
Back
Top