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.
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.
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.
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
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.
Thanks !...