Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 5th, 2003, 01:53 AM
Registered User
 
Join Date: Dec 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Use of "IF" in a ADP Stored Procedure

Hi,

How would I be able to use CASE statement if it applies to different table.
For example: I have 3 tables, billing, Job_2 and JOB_COST_Query1_Sub

I want apply this CASE statement and extract some data from the third table: cost.
How would that be possibly be done ? Sounds complicated, isn't it?
Please help .....

Example:
-----------
SELECT dbo.billing.Job_No
FROM dbo.billing INNER JOIN
dbo.Job_2 ON dbo.billing.Job_No = dbo.Job_2.Job_No INNER JOIN
dbo.JOB_COST_Query1_Sub() JOB_COST_Query1_Sub ON dbo.Job_2.Job_No = JOB_COST_Query1_Sub.Job_No
WHERE (dbo.billing.Job_No = @JobNumber)

Have tried and modified the following query, but it didn't work, why?
SELECT dbo.billing.Job_No, dbo.JOB_COST_Query_Sub, CASE WHEN [CountAFE]>1 Then 'Multiple' Else [FirstOfAFE No],
FROM dbo.billing INNER JOIN
dbo.Job_2 ON dbo.billing.Job_No = dbo.Job_2.Job_No INNER JOIN
dbo.JOB_COST_Query1_Sub() JOB_COST_Query1_Sub ON dbo.Job_2.Job_No = JOB_COST_Query1_Sub.Job_No
WHERE (dbo.billing.Job_No = @JobNumber)



Thanks.








Similar Threads
Thread Thread Starter Forum Replies Last Post
Running stored procedure from .adp module mantle51 Access VBA 1 August 13th, 2007 12:17 PM
adp- stored query problem LeoTiger1 Access 0 June 13th, 2006 04:11 PM
this Newbie has adp / stored query problems - LeoTiger1 BOOK: Access 2003 VBA Programmer's Reference 0 June 13th, 2006 03:40 PM
ADP Update Stored Procedure ashg657 Access 0 June 2nd, 2006 05:29 AM
Stored procedure as the rowsource for Report (ADP) Tero Access 1 May 12th, 2004 08:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.