By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,122 Members | 921 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,122 IT Pros & Developers. It's quick & easy.

please convert access query into stored procedure

P: 7
Can anyone please convert the below access query to the equivalent stored procedure.No problem with the IIF() function but the condition in the "where" clause making please put some light on the that part.
Also how to implement it in the VBA code.

SELECT t_activity.no_activity, IIf([activity_steps]="GP","Plan",
[activity_steps]))) AS act_steps
FROM t_activity_brand, t_customer INNER JOIN t_activity ON
t_customer.code_customer = t_activity.code_customer
WHERE (((CDate([Forms]![f_gant]![txt_debut_periode])) Between [date_start_activity] And
[date_end_activity])) OR (((CDate([Forms]![f_gant]![txt_fin_periode])) Between [date_start_activity] And
[date_end_activity])) OR (((t_activity.date_start_activity) Between [Forms]![f_gant]![txt_debut_periode] And
[Forms]![f_gant]![txt_fin_periode])) OR
(((t_activity.date_end_activity) Between [Forms]![f_gant]![txt_debut_periode] And
GROUP BY t_activity.no_activity, IIf([activity_steps]="GP","Plan",IIf([activity_steps]="Prov","Appr.",
IIf([activity_steps]="Fix","Fix",[activity_steps]))), t_customer.sm_or_key_acc, t_activity.activity_cancelled,

Thanks in advance.

Jan 10 '08 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 108
Yikes... that's a monster of a query. Before I start trying to dig through all those brackets let me ask one question. If this is a working query (or could be made to be one) why not just call the query instead of trying to code it in? This would save several head aches and system resources.

- Minioin -
Jan 10 '08 #2

P: 7
That is a access query being used in the MDB,I would like to convert it into the equivalent SPROC in the ADP and then call that SPROC into VBA.

please put some light how CDATE() function comprising form's text field can be used in the SPROC.


Jan 11 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.