Adding Values in Query

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
 
D

Duane Hookom

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
 
V

vikash.verma

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top