[AccessD] Dynamic SQL statement

Rocky Smolin rockysmolin at bchacc.com
Mon Dec 7 10:09:39 CST 2015


Maybe I misunderstood but if you're trying to append records isn't there an
INSERT clause with a list of fields followed by a SELECT clause with the
list of target fields?

r

-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of FW
Salato Center
Sent: Monday, December 07, 2015 7:54 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Dynamic SQL statement

I have two problems really: 

1.) Empty fields that must be accommodated in the SQL because they aren't
required. So, I have delimited or non-delimited results to accommodate each
time. 
2.) I wrote four different INSERT INTO statements that accommodated all
possibilities because this statement is a bit inflexible.

There's no SELECT, so I'm not sure what you're suggesting. I'm listening. :)


I fully admit to be a bit of a linear thinker. I don't always see the
possibilities because I'm looking down a straight line of here's what I've
got, here's where I need to be... code, code, code... till I get there. I
seldom see other routes until I'm done and then with that in my head, I
suddenly see other shorter routes. It's a ... curse. :) But in my mind, with
enough variables and concatenation, I see the possibility of reducing this
all to a few lines, but maybe not. :) 

It's why I never could play softball -- the ball simply never took the route
I expected and was flying by my shoulder before I knew it had left the
pitcher's mound. 

John's most likely right about the class suggestion and if I thought I'd
need more than one more input form for this, it might be a cool route to
take, if for no other purpose than to stretch my brain. You know, they're
recommending that us old folks color and do puzzles now. However... the gray
matter's not as springy as it used to be. It might snap back and hurt me.  

Susan H. 


How about two separate strings - one for the INSERT clause and one for the
SELECT clause.  Assemble them in parallel adding to both the fields you want
and then append the SELECT to the INSERT at the end?

R
  


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the AccessD mailing list