943,793 Members | Top Members by Rank

Ad:
Mar 16th, 2009
0

SQL to Access question

Expand Post »
Hello All,

I'm wondering if anyone can help me by either directing me towards a source that would help me understand Access syntax better or help me figure out if it's possible to convert this SQL syntax to Access. I've tried but can't seem to get it to work.

my SQL is
SELECT  
	substring(c.[DealerNumber],11,3) AS InsGrp, 
	substring(c.[DealerNumber],1,2) AS DlrSt, 
	c.DealerNumber, 
	c.ContractNumber, 
	substring(c.[DealerNumber],13,1) AS Expr1,
	c.ownerfname,
	c.ownerlname,
	c.address1,
	c.address2,
	c.city,
	c.state,
	c.zip,
	c.carrierid,
	carrier.carriername,
	dbo.InsuranceGroup.TPA,
	dbo.CLAIMS.ClaimNumber,		
	dbo.CLAIMSCOMP.Status,
	dbo.claims.date,	
	dbo.CLAIMS.CorrectiveAction

FROM 
	contract C
INNER JOIN 
	carrier 
ON 
	c.carrierid = carrier.carrierid
INNER JOIN 
	dbo.InsuranceGroup 
ON 
	substring(c.[DealerNumber],11,3) = dbo.InsuranceGroup.InsuranceGroup
INNER JOIN
	dbo.claims
ON
	dbo.claims.contractnumber = c.ContractNumber
INNER JOIN
	dbo.claimscomp
ON
	claims.claimnumber = claimscomp.claimnumber

WHERE 
	(((substring(c.[DealerNumber],1,2))= 'CA') 
AND 
	((substring(c.[DealerNumber],13,1))='M')) 
OR 
	(((substring(c.[DealerNumber],1,2))='IA') 
AND 
	((substring(c.[DealerNumber],13,1))<>'M'))
AND
	(((dbo.InsuranceGroup.TPA) In ('Dimension','NASC','NASC Old')))
AND 
	(((dbo.CLAIMSCOMP.Status) In ('07','93','94','de','du','dn')))
AND
	dbo.claims.[Date] > '2009-03-11 13:40:38.000'

and I seem to get errors when trying to put this into Access. I've tried the GUI but the join on substring I can't figure out. This query works fine in SQL, however, I'm trying to get it into an Access query so a user can run the report whenever they want without having to come to IT.
Thanks
Last edited by rapture; Mar 16th, 2009 at 9:38 am.
Reputation Points: 155
Solved Threads: 41
Posting Whiz in Training
rapture is offline Offline
294 posts
since Jul 2007
Jul 2nd, 2009
0

Re: SQL to Access question

Hello,

What you could try to use is an ETL tool. It can perform the job efficiently.

An ETL tool is for data integration and migration experts. It allows the user to get a graphical and functional view of integration processes.

You can look at two comparable tools: Datastage and Talend (open source) , two good ETL tools.

For more information:
<FAKE SIGNATURE>
Last edited by peter_budo; Jul 6th, 2009 at 11:03 am. Reason: Keep It On The Site - Do not manually post "fake" signatures in your posts.
gtd
Reputation Points: 18
Solved Threads: 4
Light Poster
gtd is offline Offline
31 posts
since Jul 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS Access and FileMaker Pro Forum Timeline: MS Access to be searched by a simple website.
Next Thread in MS Access and FileMaker Pro Forum Timeline: Calculated field in Access





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC