Results 1 to 5 of 5
  1. #1
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419

    Create a field that doesn't exist in DB but to fullfill other objective

    Create a field that doesn't exist but to fill enough field to do union all or to skip so the field that do exist is at x column.



    How do we do this is Access sql statement. I believe is available in sql server.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    No idea what you are asking for. What exactly are you trying to accomplish.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    I did a bunch of big complex queries. They have different number of fields.

    I want to union all of them, they need same number of fields. Thx

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I use Null. Keep in mind the first SELECT line defines the field names and data types. Example:

    SELECT LabNum, "Lab" AS Source, 1 AS Seq, m1 AS M, du1 as D, Null AS FD, Null AS ZD, Null AS ZDM FROM 108
    UNION SELECT LabNum, "Lab", 2, m2, du2, Null, Null, Null FROM 108
    UNION SELECT LabNum, "Field", 1, fieldm1, Null, fielddu1, Null, Null FROM 108
    UNION SELECT LabNum, "ZavM", 1, (1000*nz(appfine,1)-(Format(nz(mdd,0),"0")-250))/(nz(appfine,1)*(Format(nz(mdd,0),"0")-250))*100, Null, Null, Null, Format(nz(mdd,0),"0")-250 FROM 108;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Thanks !...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Create a field, if it doesn't already exist
    By jeffatwork in forum Access
    Replies: 3
    Last Post: 03-02-2016, 08:05 PM
  2. record doesn't exist
    By slimjen in forum Forms
    Replies: 7
    Last Post: 08-13-2014, 11:07 AM
  3. Replies: 19
    Last Post: 08-08-2013, 01:17 PM
  4. VBA to create PDF and folder if doesn't exist!
    By crxftw in forum Programming
    Replies: 2
    Last Post: 08-08-2011, 08:53 AM
  5. Form doesn't exist
    By Back2Basics in forum Access
    Replies: 1
    Last Post: 02-01-2010, 11:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums