Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following SQL code is from a query I run in excel as part of a VBA
macro I wrote. You can see that it prompts me for 2 date parameters and a division parameter. I would like to pass these parameters to 3 subsequent queries that use the same dates and division. Currently, the user must re-enter these parameters 4 times for the macro to complete processing. This is very cumbersome and leaves much room for error. How do I save the variables and pass them to each query? SELECT CMASCP.CPCUS, CMASTR.CU_NME, CMASCP.CPDIV, CMASCP.CP_CID, CMASCP.CPCDTE, CMASCP.CPCSMN, CMASCP.CPTYP, CMASCP.CPCDET, CMASCP.CPSEQ FROM S10BB89B.QS36F.CMASCP CMASCP, S10BB89B.QS36F.CMASTR CMASTR WHERE CMASCP.CPCUS = CMASTR.CU_CUS AND CMASCP.CPDIV = CMASTR.CU_DIV AND CMASCP.CPCO = CMASTR.CU_CO AND ((CMASCP.CPCDTE Between ? And ?) AND (CMASCP.CPDIV=?)) Thanks for any suggestions. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passing Dates criteria in MS Query | Excel Discussion (Misc queries) | |||
Passing Query String into MS Excel | Excel Programming | |||
Passing Query String into MS Excel | Excel Discussion (Misc queries) | |||
passing parameter to a ms query | Excel Programming | |||
Passing parameter to a query | Excel Programming |