Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

Giorgio's query suggestion needs to be refined a bit.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Johnny Bright - 16 Nov 2005 15:33 GMT
Hi there!

Thanks so much to Giorgio and Michael who replied to my posting yesterday.  
I was given an excellent suggestion yesterday on how to streamline my
queries and was given the following suggestion to run the following 6 queries
in my code:

Update tblFinalData
               SET GSTRatio = IIF(IsNull([GSTRation]),0,GSTRatio), _
               HSTRatio = IIF(IsNull(HSTRatio),0,HSTRatio), _
               QSTRatio = IIF(IsNull(QSTRatio),0,QSTRatio), _
               Wildcard1 = IIF(IsNull(Wildcard1),"Empty",Wildcard1), _
               Wildcard2 = IIF(IsNull(Wildcard2),"Empty",Wildcard2), _
               Wildcard3 = IIf(IsNull(Wildcard3), "Empty", Wildcard3)

However, I get an "Expected End of Statement" error with the comma before
the line continuation character being highlighted in the second row of this
code.  Am I missing a bracket somewhere or a comma or are there too many
commas?  I've tried this with and without the line continuation character and
it still doesn't seem to work.

Thanks!

JR
Signature

www.brightfuture.ca/bright
My email address can be found on my site.

John Vinson - 16 Nov 2005 17:27 GMT
>Hi there!
>
[quoted text clipped - 16 lines]
>commas?  I've tried this with and without the line continuation character and
>it still doesn't seem to work.

Where are you running this? VBA and SQL are two different languages,
and the query engine doesn't understand VBA, while the VBA compiler
doesn't know SQL. It looks like you're trying to execute this SQL
query from VBA. Won't work!

Put it (without the underscores, which are not used in SQL) into the
SQL window of a new query and it should work fine.

                 John W. Vinson[MVP]    
Ofer - 16 Nov 2005 18:22 GMT
Are you using this SQL in a query?
If so, remove the _ from the Ens of the line

Update tblFinalData
SET GSTRatio = IIF(IsNull([GSTRation]),0,GSTRatio),
HSTRatio = IIF(IsNull(HSTRatio),0,HSTRatio),
QSTRatio = IIF(IsNull(QSTRatio),0,QSTRatio),
Wildcard1 = IIF(IsNull(Wildcard1),"Empty",Wildcard1),
Wildcard2 = IIF(IsNull(Wildcard2),"Empty",Wildcard2),
Wildcard3 = IIf(IsNull(Wildcard3), "Empty", Wildcard3)

Signature

I hope that helped
Good Luck

> Hi there!
>
[quoted text clipped - 20 lines]
>
> JR
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.