Moving between SQL and Access there are a few tricks you need to know.   I thought it would be good to show some common areas which are stumbling blocks:


Access vs SQL

CInt and CString    use       Cast or Convert (depending on scenario)

Nz([Field1,null)      use       Coalesce([field1],[field2],null, ….)

“string”                     use       ‘string’

#date#                      use       ‘date’

append query          use       insert

Like “*string”            use       like ‘%string’   (the % is the wildcard)

dbo_tblname           use       dbo.tblname     (the linked table can’t hold a “.” in it, and replaces it with an “_”.

Query                         create          View

 Creating a VIEW to use in Access:

For moves to SQL, think about switching to Views for your larger power queries.  This will radically improve your database and the results of your queries.

  1. Build queries in Access.
  2. Change view to SQL View.
  3. Copy the code.
  4. Go to SSMS.
  5. Create a new View.
  6. Paste the code.
  7. Clean up the syntax (see above).
  8. Execute, test and debug.
  9. Save as a new View.
  10. In access link to the view and don’t use your query.

Result = WAY FASTER QUERIES!  Views run server side on SQL Server, Queries are hit and miss and tend to pull data locally and run client side.  If you like this, say “thanks Jeff!”.  You’re welcome!

Jeff Shirley

Jeff Shirley

Founder & CEO
Jeff brings over 27 years of experience to the table, along with numerous awards, certifications, and real-world implementations.  His database solutions are currently running in industries including government, mining, agriculture, finance, education, science, research, non-profits, and healthcare businesses around North America and serve thousands of users day to day.  Jeff is a five-time MVP Award recipient for Microsoft Access, acknowledging contributions to community projects, evangelism, and educational outreach on Microsoft technologies.  Today there are less than 50 Access MVP’s worldwide. While Jeff focuses day to day on business management, IoT development, IT integrations and design, database architecture or other typical complex tasks, he also is a co-owner of Blue Heron Gardens, a commercial apiary running over 200 beehives.  Fresh honey is a small perk for many of our clients!

Mitch Redekopp

Mitch works with our clients day to day ensuring web development and IT projects are done to exceed customer expectations.  His background includes formal training in IT, Microsoft and CompTIA certifications, real-world business experience, and a true dedication to ensuring clients receive timely and professional support on their projects with Rivercity Technology Services.  Given the most difficult requests for IT solutions, Mitchell can assist our clients in finding a path to the best options which deliver results for our clients.  Mitchell is an avid soccer player and Manchester City fan, be sure to talk soccer with him when you can.