Present Date less 30 days into default parameter

Maurizio

Well-known Member
Joined
Oct 15, 2002
Messages
691
Office Version
  1. 2007
Platform
  1. Windows
Is it possible to get into prompt ">=[From Date]", below default parametr, Present Date less 30 days like Excel's way?

Sub NewSistemDate()
NewDate = Application.InputBox("new date is ", "Choise new date", Format(Date - 30, "dd/mm/yy"))
End Sub


SELECT none_ANACLF.CLF_RGSOC, none_BOLCTE.BCT_DATA, none_BOLCRI.BCR_DESCR, none_BOLCRI.BCR_PZLOR, Round(([none_BOLCRI]![BCR_PZLOR]*1936.27)/100)*100 AS Lire, none_BOLCTE.BCT_BOL
FROM (none_BOLCRI INNER JOIN none_BOLCTE ON (none_BOLCRI.BCR_AZI = none_BOLCTE.BCT_AZI) AND (none_BOLCRI.BCR_NUM = none_BOLCTE.BCT_NUM) AND (none_BOLCRI.BCR_BOL = none_BOLCTE.BCT_BOL)) INNER JOIN none_ANACLF ON (none_BOLCTE.BCT_CLI = none_ANACLF.CLF_CD) AND (none_BOLCTE.BCT_AZI = none_ANACLF.CLF_AZI)
WHERE (((none_BOLCTE.BCT_DATA)>=[From Date]) AND ((none_BOLCRI.BCR_DESCR) Like "*" & UCase([ARTICOLO]) & "*") AND ((none_BOLCTE.BCT_CLI)=[CODICE Cliente]) AND ((none_BOLCRI.BCR_TCOR)<>1) AND ((none_ANACLF.CLF_MS)=98) AND ((none_BOLCRI.BCR_AZI)=2))
ORDER BY none_BOLCTE.BCT_DATA DESC , none_BOLCRI.BCR_DESCR;


Tia.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
You can do something like this:

In a module, enter a function like the following:

Code:
Public Function GetDate() as Date
    GetDate = InputBox("Please Enter a Date","MyTitle",DateAdd("d",-30,Date))
End Function

Then, in your query wizard, in the Criteria line for your Date field (BCT_DATA), put:

>= GetDate()

HTH,

Russell
 
Upvote 0

Forum statistics

Threads
1,221,522
Messages
6,160,308
Members
451,637
Latest member
hvp2262

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top