Hello Everyone,
I have created a SQL stored procedure to pull data from various SQL tables. I have also created a pass thru query to be able to not pull all of the data, but just records based on a date range.
The pass thru query's syntax that works looks as follows:
exec [cp_ProdRptPMSbyUser-1] '01/01/2012', '01/31/2012'
This syntax works fine, but I am trying to get this pass thru to recognize the values from two textboxes that contain date values on a form. I've tried the following as my pass thru syntax, but these don't work.
1. exec [cp_ProdRptPMSbyUser-1] ' & Forms!frmProdRpt!StrtDte & ', ' & Forms!frmProdRpt!EndDte & '
2. exec [cp_ProdRptPMSbyUser-1] Forms!frmProdRpt!StrtDte, Forms!frmProdRpt!EndDte
3. exec [cp_ProdRptPMSbyUser-1] "' & Forms!frmProdRpt!StrtDte & '", "' & Forms!frmProdRpt!EndDte & '"
4. exec [cp_ProdRptPMSbyUser-1] '" & Forms!frmProdRpt!StrtDte & "', '" & Forms!frmProdRpt!EndDte & "'
Can anyone assist me with this syntax?
Your assistance is greatly appreciated.
I have created a SQL stored procedure to pull data from various SQL tables. I have also created a pass thru query to be able to not pull all of the data, but just records based on a date range.
The pass thru query's syntax that works looks as follows:
exec [cp_ProdRptPMSbyUser-1] '01/01/2012', '01/31/2012'
This syntax works fine, but I am trying to get this pass thru to recognize the values from two textboxes that contain date values on a form. I've tried the following as my pass thru syntax, but these don't work.
1. exec [cp_ProdRptPMSbyUser-1] ' & Forms!frmProdRpt!StrtDte & ', ' & Forms!frmProdRpt!EndDte & '
2. exec [cp_ProdRptPMSbyUser-1] Forms!frmProdRpt!StrtDte, Forms!frmProdRpt!EndDte
3. exec [cp_ProdRptPMSbyUser-1] "' & Forms!frmProdRpt!StrtDte & '", "' & Forms!frmProdRpt!EndDte & '"
4. exec [cp_ProdRptPMSbyUser-1] '" & Forms!frmProdRpt!StrtDte & "', '" & Forms!frmProdRpt!EndDte & "'
Can anyone assist me with this syntax?
Your assistance is greatly appreciated.