<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Read fields from SQL database with field names lower case only? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439560#M700591</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still...&amp;nbsp; If you develop the practice of naming your fields and not using select * you will always avoid this problem unless they completely change the name (which will always break things).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Oct 2012 14:24:27 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-10-22T14:24:27Z</dc:date>
    <item>
      <title>Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439556#M700587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having an issue with how qlikview reads fields from the database. I know SQL usually is not case sensitive when it comes to field names and table names. &lt;/P&gt;&lt;P&gt;Unfortunately we just upgraded our software and server so we now have a new database (Same tables and field names). In this new database instead of the fields being all lower case they are now like this example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Old Field: sendalertcomplete&lt;/P&gt;&lt;P&gt;New Field: SendAlertComplete&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now since Qlikview reads the database as case sensitive, Qlikview cannot find any of my fields. Remembering where the letters are capitalized at will be a huge pain, especially when I have 30+ tables in some of my documents. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know if there is a way to turn off case sensitivity when reading from SQL or transforming the field names so that they are lower case? I know doing the following is an option, but this will be cumbersome to do for every field for every table. (SendAlertComplete as sendalertcomplete)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: Ok I tested and I dont have to do Table as table in the SQL Select portion of the scripts. Simply stating table pulls the information still. This is still annoying though as I am not unable to simply say Select * from; I now have to list every field from the table to get the proper case...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 12:32:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439556#M700587</guid>
      <dc:creator />
      <dc:date>2012-10-22T12:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439557#M700588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like you might need to load the SQL columns into a temp table in the new upper+lower case format, then run a routine to rename (lowercase) these columns THEN do a resident load for the QV side of things.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO {ODBC connection};&lt;/P&gt;&lt;P&gt;tmp:&lt;/P&gt;&lt;P&gt;SQL SELECT {columns} FROM {SQLTable};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For f = 1 to NoOfFields('tmp')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vFieldOld = FieldName($(f),'tmp');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vFieldNew = Lower('$(vFieldOld)');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RENAME FIELD $(vFieldOld) to $(vFieldNew);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next f;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FinalTable:&lt;/P&gt;&lt;P&gt;LOAD {QV logic} resident tmp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An easier alternative may be to create views SQL side of your tables with lowercase names and read from them instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 13:34:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439557#M700588</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-10-22T13:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439558#M700589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SQL is not case sensitive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When pulling data name the fields in lower case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load *;&lt;/P&gt;&lt;P&gt;SQL Select sendalertcomplete from tblName;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 14:15:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439558#M700589</guid>
      <dc:creator />
      <dc:date>2012-10-22T14:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439559#M700590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm guessing that marcsliving is referring to the preceding load part of his script and is just trying to avoid the effort required in amending his fieldnames in his load scripts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 14:19:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439559#M700590</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-10-22T14:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439560#M700591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still...&amp;nbsp; If you develop the practice of naming your fields and not using select * you will always avoid this problem unless they completely change the name (which will always break things).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 14:24:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439560#M700591</guid>
      <dc:creator />
      <dc:date>2012-10-22T14:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439561#M700592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very true &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 14:28:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439561#M700592</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-10-22T14:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439562#M700593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;flipside is right, I am refering only to the SQL part. SQL does not care about case sensitivity, so it pulls as it reads. The original data has the caps, so if I do Select * it pulls all the data with the caps in the names. If I just paste every field name lower case in the select area then it pulls it in lower case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am doing other manipulations to the data in the load section (rtrim(text())) to every string in the table so I wanted to avoid entering every field twice. I am storing the entire table inside of a QVD to use in other documents. Naming of the fields is happening later in a resident load, or in the later documents, when the data is pulled from the QVD. The bigger problem as I said before is not that the actual names changed, it is just that with the update the fields are no longer base stored all lower case. When you are selecting entire Tables to then manipulate and restore into a QVD it was just easier and more space effective to do Select * (cannot do Load * as the text function needs to be done in the Load section to make sure qliview sees string fields containing numbers as only string fields)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This all started from an earlier issue where I found out our data needs to keep leading spaces and drop only trailing spaces. Since Verbatim only works for all leading and trailing I need to apply rtrim to every string as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside: I will look into your method, however I am not very familiar with doing routines, and since from looking at your example I would need to paste every field into this any way SQL SELECT {columns} FROM {SQLTable}; &lt;/P&gt;&lt;P&gt;It would probably just be easier to enter every field as lowercase in the select area anyway to avoid this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 14:37:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439562#M700593</guid>
      <dc:creator />
      <dc:date>2012-10-22T14:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439563#M700594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would have thought the easiest solution would be to create views in the database with the lowercased field names as it would be very little different than reading direct from a single table as the view is also based on a single table.&amp;nbsp; However the routine I suggested isn't too difficult to implement and you can still use a select * SQL command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i assume you have at the moment is ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FinalTable:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {QV logic};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL SELECT * from {sql table};&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have suggested is to change this to ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL SELECT * from {sql table};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For f = 1 to NoOfFields('tmp')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vFieldOld = FieldName($(f),'tmp');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vFieldNew = Lower('$(vFieldOld)');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RENAME FIELD $(vFieldOld) to $(vFieldNew);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next f;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FinalTable:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NOCONCATENATE LOAD {QV logic} resident tmp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Drop Table tmp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could be a performance downside, though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 14:52:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439563#M700594</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-10-22T14:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439564#M700595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example of what I have for one of the larger tables. As you can see it is already quite long. As I also said I am doing this for around 30 tables in the first document, 20+ in the second etc.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Order1:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;openorder,&lt;/P&gt;&lt;P&gt;voidorder,&lt;/P&gt;&lt;P&gt;rtrim(text(company)) as 'company',&lt;/P&gt;&lt;P&gt;ordernum,&lt;/P&gt;&lt;P&gt;custnum,&lt;/P&gt;&lt;P&gt;rtrim(text(ponum)) as 'ponum',&lt;/P&gt;&lt;P&gt;orderheld,&lt;/P&gt;&lt;P&gt;rtrim(text(entryperson)) as 'entryperson',&lt;/P&gt;&lt;P&gt;rtrim(text(shiptonum)) as 'shiptonum',&lt;/P&gt;&lt;P&gt;requestdate,&lt;/P&gt;&lt;P&gt;orderdate,&lt;/P&gt;&lt;P&gt;rtrim(text(fob)) as 'fob',&lt;/P&gt;&lt;P&gt;rtrim(text(shipviacode)) as 'shipviacode',&lt;/P&gt;&lt;P&gt;rtrim(text(termscode)) as 'termscode',&lt;/P&gt;&lt;P&gt;discountpercent,&lt;/P&gt;&lt;P&gt;prcconnum,&lt;/P&gt;&lt;P&gt;shpconnum,&lt;/P&gt;&lt;P&gt;rtrim(text(salesreplist)) as 'salesreplist',&lt;/P&gt;&lt;P&gt;rtrim(text(userchar1)) as 'userchar1',&lt;/P&gt;&lt;P&gt;rtrim(text(userchar2)) as 'userchar2',&lt;/P&gt;&lt;P&gt;rtrim(text(userchar3)) as 'userchar3',&lt;/P&gt;&lt;P&gt;rtrim(text(userchar4)) as 'userchar4',&lt;/P&gt;&lt;P&gt;userdate1,&lt;/P&gt;&lt;P&gt;userdate2,&lt;/P&gt;&lt;P&gt;userdate3,&lt;/P&gt;&lt;P&gt;userdate4,&lt;/P&gt;&lt;P&gt;userdecimal1,&lt;/P&gt;&lt;P&gt;userdecimal2,&lt;/P&gt;&lt;P&gt;userinteger1,&lt;/P&gt;&lt;P&gt;userinteger2,&lt;/P&gt;&lt;P&gt;rtrim(text(ordercomment)) as 'ordercomment',&lt;/P&gt;&lt;P&gt;rtrim(text(shipcomment)) as 'shipcomment',&lt;/P&gt;&lt;P&gt;rtrim(text(invoicecomment)) as 'invoicecomment',&lt;/P&gt;&lt;P&gt;rtrim(text(picklistcomment)) as 'picklistcomment',&lt;/P&gt;&lt;P&gt;depositbal,&lt;/P&gt;&lt;P&gt;docdepositbal,&lt;/P&gt;&lt;P&gt;needbydate,&lt;/P&gt;&lt;P&gt;creditoverride,&lt;/P&gt;&lt;P&gt;rtrim(text(creditoverrideuserid)) as 'creditoverrideuserid',&lt;/P&gt;&lt;P&gt;creditoverridedate,&lt;/P&gt;&lt;P&gt;rtrim(text(creditoverridetime)) as 'creditoverridetime',&lt;/P&gt;&lt;P&gt;creditoverridelimit,&lt;/P&gt;&lt;P&gt;rtrim(text(character01)) as 'character01',&lt;/P&gt;&lt;P&gt;rtrim(text(character02)) as 'character02',&lt;/P&gt;&lt;P&gt;rtrim(text(character03)) as 'character03',&lt;/P&gt;&lt;P&gt;rtrim(text(character04)) as 'character04',&lt;/P&gt;&lt;P&gt;rtrim(text(character05)) as 'character05',&lt;/P&gt;&lt;P&gt;rtrim(text(character06)) as 'character06',&lt;/P&gt;&lt;P&gt;rtrim(text(character07)) as 'character07',&lt;/P&gt;&lt;P&gt;rtrim(text(character08)) as 'character08',&lt;/P&gt;&lt;P&gt;rtrim(text(character09)) as 'character09',&lt;/P&gt;&lt;P&gt;rtrim(text(character10)) as 'character10',&lt;/P&gt;&lt;P&gt;number01,&lt;/P&gt;&lt;P&gt;number02,&lt;/P&gt;&lt;P&gt;number03,&lt;/P&gt;&lt;P&gt;number04,&lt;/P&gt;&lt;P&gt;number05,&lt;/P&gt;&lt;P&gt;number06,&lt;/P&gt;&lt;P&gt;number07,&lt;/P&gt;&lt;P&gt;number08,&lt;/P&gt;&lt;P&gt;number09,&lt;/P&gt;&lt;P&gt;number10,&lt;/P&gt;&lt;P&gt;date01,&lt;/P&gt;&lt;P&gt;date02,&lt;/P&gt;&lt;P&gt;date03,&lt;/P&gt;&lt;P&gt;date04,&lt;/P&gt;&lt;P&gt;date05,&lt;/P&gt;&lt;P&gt;checkbox01,&lt;/P&gt;&lt;P&gt;checkbox02,&lt;/P&gt;&lt;P&gt;checkbox03,&lt;/P&gt;&lt;P&gt;checkbox04,&lt;/P&gt;&lt;P&gt;checkbox05,&lt;/P&gt;&lt;P&gt;sndalrtshp,&lt;/P&gt;&lt;P&gt;exchangerate,&lt;/P&gt;&lt;P&gt;rtrim(text(currencycode)) as 'currencycode',&lt;/P&gt;&lt;P&gt;lockrate,&lt;/P&gt;&lt;P&gt;rtrim(text(cardmembername)) as 'cardmembername',&lt;/P&gt;&lt;P&gt;rtrim(text(cardnumber)) as 'cardnumber',&lt;/P&gt;&lt;P&gt;rtrim(text(cardtype)) as 'cardtype',&lt;/P&gt;&lt;P&gt;expirationmonth,&lt;/P&gt;&lt;P&gt;expirationyear,&lt;/P&gt;&lt;P&gt;rtrim(text(cardid)) as 'cardid',&lt;/P&gt;&lt;P&gt;rtrim(text(cardmemberreference)) as 'cardmemberreference',&lt;/P&gt;&lt;P&gt;rtrim(text(allocprioritycode)) as 'allocprioritycode',&lt;/P&gt;&lt;P&gt;rtrim(text(reserveprioritycode)) as 'reserveprioritycode',&lt;/P&gt;&lt;P&gt;shipordercomplete,&lt;/P&gt;&lt;P&gt;weborder,&lt;/P&gt;&lt;P&gt;rtrim(text(ccapprovalnum)) as 'ccapprovalnum',&lt;/P&gt;&lt;P&gt;ediorder,&lt;/P&gt;&lt;P&gt;ediack,&lt;/P&gt;&lt;P&gt;linked,&lt;/P&gt;&lt;P&gt;icponum,&lt;/P&gt;&lt;P&gt;rtrim(text(extcompany)) as 'extcompany',&lt;/P&gt;&lt;P&gt;rtrim(text(webentryperson)) as 'webentryperson',&lt;/P&gt;&lt;P&gt;ackemailsent,&lt;/P&gt;&lt;P&gt;applyorderbaseddisc,&lt;/P&gt;&lt;P&gt;autoorderbaseddisc,&lt;/P&gt;&lt;P&gt;rtrim(text(entrymethod)) as 'entrymethod',&lt;/P&gt;&lt;P&gt;hdcasenum,&lt;/P&gt;&lt;P&gt;countersale,&lt;/P&gt;&lt;P&gt;createinvoice,&lt;/P&gt;&lt;P&gt;createpackingslip,&lt;/P&gt;&lt;P&gt;number11,&lt;/P&gt;&lt;P&gt;number12,&lt;/P&gt;&lt;P&gt;number13,&lt;/P&gt;&lt;P&gt;number14,&lt;/P&gt;&lt;P&gt;number15,&lt;/P&gt;&lt;P&gt;number16,&lt;/P&gt;&lt;P&gt;number17,&lt;/P&gt;&lt;P&gt;number18,&lt;/P&gt;&lt;P&gt;number19,&lt;/P&gt;&lt;P&gt;number20,&lt;/P&gt;&lt;P&gt;date06,&lt;/P&gt;&lt;P&gt;date07,&lt;/P&gt;&lt;P&gt;date08,&lt;/P&gt;&lt;P&gt;date09,&lt;/P&gt;&lt;P&gt;date10,&lt;/P&gt;&lt;P&gt;date11,&lt;/P&gt;&lt;P&gt;date12,&lt;/P&gt;&lt;P&gt;date13,&lt;/P&gt;&lt;P&gt;date14,&lt;/P&gt;&lt;P&gt;date15,&lt;/P&gt;&lt;P&gt;date16,&lt;/P&gt;&lt;P&gt;date17,&lt;/P&gt;&lt;P&gt;date18,&lt;/P&gt;&lt;P&gt;date19,&lt;/P&gt;&lt;P&gt;date20,&lt;/P&gt;&lt;P&gt;checkbox06,&lt;/P&gt;&lt;P&gt;checkbox07,&lt;/P&gt;&lt;P&gt;checkbox08,&lt;/P&gt;&lt;P&gt;checkbox09,&lt;/P&gt;&lt;P&gt;checkbox10,&lt;/P&gt;&lt;P&gt;checkbox11,&lt;/P&gt;&lt;P&gt;checkbox12,&lt;/P&gt;&lt;P&gt;checkbox13,&lt;/P&gt;&lt;P&gt;checkbox14,&lt;/P&gt;&lt;P&gt;checkbox15,&lt;/P&gt;&lt;P&gt;checkbox16,&lt;/P&gt;&lt;P&gt;checkbox17,&lt;/P&gt;&lt;P&gt;checkbox18,&lt;/P&gt;&lt;P&gt;checkbox19,&lt;/P&gt;&lt;P&gt;checkbox20,&lt;/P&gt;&lt;P&gt;rtrim(text(shortchar01)) as 'shortchar01',&lt;/P&gt;&lt;P&gt;rtrim(text(shortchar02)) as 'shortchar02',&lt;/P&gt;&lt;P&gt;rtrim(text(shortchar03)) as 'shortchar03',&lt;/P&gt;&lt;P&gt;rtrim(text(shortchar04)) as 'shortchar04',&lt;/P&gt;&lt;P&gt;rtrim(text(shortchar05)) as 'shortchar05',&lt;/P&gt;&lt;P&gt;rtrim(text(shortchar06)) as 'shortchar06',&lt;/P&gt;&lt;P&gt;rtrim(text(shortchar07)) as 'shortchar07',&lt;/P&gt;&lt;P&gt;rtrim(text(shortchar08)) as 'shortchar08',&lt;/P&gt;&lt;P&gt;rtrim(text(shortchar09)) as 'shortchar09',&lt;/P&gt;&lt;P&gt;rtrim(text(shortchar10)) as 'shortchar10',&lt;/P&gt;&lt;P&gt;lockqty,&lt;/P&gt;&lt;P&gt;rtrim(text(processcard)) as 'processcard',&lt;/P&gt;&lt;P&gt;ccamount,&lt;/P&gt;&lt;P&gt;ccfreight,&lt;/P&gt;&lt;P&gt;cctax,&lt;/P&gt;&lt;P&gt;cctotal,&lt;/P&gt;&lt;P&gt;ccdocamount,&lt;/P&gt;&lt;P&gt;ccdocfreight,&lt;/P&gt;&lt;P&gt;ccdoctax,&lt;/P&gt;&lt;P&gt;ccdoctotal,&lt;/P&gt;&lt;P&gt;rtrim(text(ccstreetaddr)) as 'ccstreetaddr',&lt;/P&gt;&lt;P&gt;rtrim(text(cczip)) as 'cczip',&lt;/P&gt;&lt;P&gt;btcustnum,&lt;/P&gt;&lt;P&gt;btconnum,&lt;/P&gt;&lt;P&gt;reprate4,&lt;/P&gt;&lt;P&gt;reprate5,&lt;/P&gt;&lt;P&gt;repsplit1,&lt;/P&gt;&lt;P&gt;repsplit2,&lt;/P&gt;&lt;P&gt;repsplit3,&lt;/P&gt;&lt;P&gt;repsplit4,&lt;/P&gt;&lt;P&gt;repsplit5,&lt;/P&gt;&lt;P&gt;reprate1,&lt;/P&gt;&lt;P&gt;reprate2,&lt;/P&gt;&lt;P&gt;reprate3,&lt;/P&gt;&lt;P&gt;outboundsalesdocctr,&lt;/P&gt;&lt;P&gt;outboundshipdocsctr,&lt;/P&gt;&lt;P&gt;demandcontractnum,&lt;/P&gt;&lt;P&gt;donotshipbeforedate,&lt;/P&gt;&lt;P&gt;resdelivery,&lt;/P&gt;&lt;P&gt;donotshipafterdate,&lt;/P&gt;&lt;P&gt;satdelivery,&lt;/P&gt;&lt;P&gt;satpickup,&lt;/P&gt;&lt;P&gt;hazmat,&lt;/P&gt;&lt;P&gt;doconly,&lt;/P&gt;&lt;P&gt;rtrim(text(refnotes)) as 'refnotes',&lt;/P&gt;&lt;P&gt;applychrg,&lt;/P&gt;&lt;P&gt;chrgamount,&lt;/P&gt;&lt;P&gt;cod,&lt;/P&gt;&lt;P&gt;codfreight,&lt;/P&gt;&lt;P&gt;codcheck,&lt;/P&gt;&lt;P&gt;codamount,&lt;/P&gt;&lt;P&gt;rtrim(text(groundtype)) as 'groundtype',&lt;/P&gt;&lt;P&gt;notifyflag,&lt;/P&gt;&lt;P&gt;rtrim(text(notifyemail)) as 'notifyemail',&lt;/P&gt;&lt;P&gt;declaredins,&lt;/P&gt;&lt;P&gt;declaredamt,&lt;/P&gt;&lt;P&gt;cancelafterdate,&lt;/P&gt;&lt;P&gt;demandrejected,&lt;/P&gt;&lt;P&gt;overridecarrier,&lt;/P&gt;&lt;P&gt;overrideservice,&lt;/P&gt;&lt;P&gt;creditcardorder,&lt;/P&gt;&lt;P&gt;demandheadseq,&lt;/P&gt;&lt;P&gt;rtrim(text(payflag)) as 'payflag',&lt;/P&gt;&lt;P&gt;rtrim(text(payaccount)) as 'payaccount',&lt;/P&gt;&lt;P&gt;rtrim(text(paybtaddress1)) as 'paybtaddress1',&lt;/P&gt;&lt;P&gt;rtrim(text(paybtaddress2)) as 'paybtaddress2',&lt;/P&gt;&lt;P&gt;rtrim(text(paybtcity)) as 'paybtcity',&lt;/P&gt;&lt;P&gt;rtrim(text(paybtstate)) as 'paybtstate',&lt;/P&gt;&lt;P&gt;rtrim(text(paybtzip)) as 'paybtzip',&lt;/P&gt;&lt;P&gt;rtrim(text(paybtcountry)) as 'paybtcountry',&lt;/P&gt;&lt;P&gt;dropship,&lt;/P&gt;&lt;P&gt;commercialinvoice,&lt;/P&gt;&lt;P&gt;shipexprtdeclartn,&lt;/P&gt;&lt;P&gt;certoforigin,&lt;/P&gt;&lt;P&gt;letterofinstr,&lt;/P&gt;&lt;P&gt;rtrim(text(ffid)) as 'ffid',&lt;/P&gt;&lt;P&gt;rtrim(text(ffaddress1)) as 'ffaddress1',&lt;/P&gt;&lt;P&gt;rtrim(text(ffaddress2)) as 'ffaddress2',&lt;/P&gt;&lt;P&gt;rtrim(text(ffcity)) as 'ffcity',&lt;/P&gt;&lt;P&gt;rtrim(text(ffstate)) as 'ffstate',&lt;/P&gt;&lt;P&gt;rtrim(text(ffzip)) as 'ffzip',&lt;/P&gt;&lt;P&gt;rtrim(text(ffcountry)) as 'ffcountry',&lt;/P&gt;&lt;P&gt;rtrim(text(ffcontact)) as 'ffcontact',&lt;/P&gt;&lt;P&gt;rtrim(text(ffcompname)) as 'ffcompname',&lt;/P&gt;&lt;P&gt;rtrim(text(ffphonenum)) as 'ffphonenum',&lt;/P&gt;&lt;P&gt;intrntlship,&lt;/P&gt;&lt;P&gt;rtrim(text(changedby)) as 'changedby',&lt;/P&gt;&lt;P&gt;changedate,&lt;/P&gt;&lt;P&gt;changetime,&lt;/P&gt;&lt;P&gt;autoprintready,&lt;/P&gt;&lt;P&gt;ediready,&lt;/P&gt;&lt;P&gt;individualpackids,&lt;/P&gt;&lt;P&gt;rtrim(text(ffaddress3)) as 'ffaddress3',&lt;/P&gt;&lt;P&gt;deliveryconf,&lt;/P&gt;&lt;P&gt;addlhdlgflag,&lt;/P&gt;&lt;P&gt;nonstdpkg,&lt;/P&gt;&lt;P&gt;servsignature,&lt;/P&gt;&lt;P&gt;servalert,&lt;/P&gt;&lt;P&gt;servhomedel,&lt;/P&gt;&lt;P&gt;rtrim(text(deliverytype)) as 'deliverytype',&lt;/P&gt;&lt;P&gt;servdeliverydate,&lt;/P&gt;&lt;P&gt;rtrim(text(servinstruct)) as 'servinstruct',&lt;/P&gt;&lt;P&gt;rtrim(text(servref1)) as 'servref1',&lt;/P&gt;&lt;P&gt;rtrim(text(servref2)) as 'servref2',&lt;/P&gt;&lt;P&gt;rtrim(text(servref3)) as 'servref3',&lt;/P&gt;&lt;P&gt;rtrim(text(servref4)) as 'servref4',&lt;/P&gt;&lt;P&gt;rtrim(text(servref5)) as 'servref5',&lt;/P&gt;&lt;P&gt;ffcountrynum,&lt;/P&gt;&lt;P&gt;rtrim(text(servphone)) as 'servphone',&lt;/P&gt;&lt;P&gt;servrelease,&lt;/P&gt;&lt;P&gt;rtrim(text(servauthnum)) as 'servauthnum',&lt;/P&gt;&lt;P&gt;rtrim(text(paybtaddress3)) as 'paybtaddress3',&lt;/P&gt;&lt;P&gt;paybtcountrynum,&lt;/P&gt;&lt;P&gt;rtrim(text(paybtphone)) as 'paybtphone',&lt;/P&gt;&lt;P&gt;upsquantumview,&lt;/P&gt;&lt;P&gt;rtrim(text(upsqvshipfromname)) as 'upsqvshipfromname',&lt;/P&gt;&lt;P&gt;rtrim(text(upsqvmemo)) as 'upsqvmemo',&lt;/P&gt;&lt;P&gt;readytocalc,&lt;/P&gt;&lt;P&gt;totalcharges,&lt;/P&gt;&lt;P&gt;totalmisc,&lt;/P&gt;&lt;P&gt;totaldiscount,&lt;/P&gt;&lt;P&gt;totalcomm,&lt;/P&gt;&lt;P&gt;totaladvbill,&lt;/P&gt;&lt;P&gt;totallines,&lt;/P&gt;&lt;P&gt;totalreleases,&lt;/P&gt;&lt;P&gt;totalreldates,&lt;/P&gt;&lt;P&gt;doctotalcharges,&lt;/P&gt;&lt;P&gt;doctotalmisc,&lt;/P&gt;&lt;P&gt;doctotaldiscount,&lt;/P&gt;&lt;P&gt;doctotalcomm,&lt;/P&gt;&lt;P&gt;totaltax,&lt;/P&gt;&lt;P&gt;doctotaltax,&lt;/P&gt;&lt;P&gt;doctotaladvbill,&lt;/P&gt;&lt;P&gt;totalshipped,&lt;/P&gt;&lt;P&gt;totalinvoiced,&lt;/P&gt;&lt;P&gt;totalcommlines,&lt;/P&gt;&lt;P&gt;srcommamt1,&lt;/P&gt;&lt;P&gt;srcommamt2,&lt;/P&gt;&lt;P&gt;srcommamt3,&lt;/P&gt;&lt;P&gt;srcommamt4,&lt;/P&gt;&lt;P&gt;srcommamt5,&lt;/P&gt;&lt;P&gt;srcommableamt1,&lt;/P&gt;&lt;P&gt;srcommableamt2,&lt;/P&gt;&lt;P&gt;srcommableamt3,&lt;/P&gt;&lt;P&gt;srcommableamt4,&lt;/P&gt;&lt;P&gt;srcommableamt5,&lt;/P&gt;&lt;P&gt;rounding,&lt;/P&gt;&lt;P&gt;rpt1depositbal,&lt;/P&gt;&lt;P&gt;docrounding,&lt;/P&gt;&lt;P&gt;rpt2depositbal,&lt;/P&gt;&lt;P&gt;rpt3depositbal,&lt;/P&gt;&lt;P&gt;rpt1totalcharges,&lt;/P&gt;&lt;P&gt;rpt2totalcharges,&lt;/P&gt;&lt;P&gt;rpt3totalcharges,&lt;/P&gt;&lt;P&gt;rpt1totaladvbill,&lt;/P&gt;&lt;P&gt;rpt2totaladvbill,&lt;/P&gt;&lt;P&gt;rpt3totaladvbill,&lt;/P&gt;&lt;P&gt;rpt1totalmisc,&lt;/P&gt;&lt;P&gt;rpt2totalmisc,&lt;/P&gt;&lt;P&gt;rpt3totalmisc,&lt;/P&gt;&lt;P&gt;rpt1totaldiscount,&lt;/P&gt;&lt;P&gt;rpt2totaldiscount,&lt;/P&gt;&lt;P&gt;rpt3totaldiscount,&lt;/P&gt;&lt;P&gt;rpt1totalcomm,&lt;/P&gt;&lt;P&gt;rpt2totalcomm,&lt;/P&gt;&lt;P&gt;rpt3totalcomm,&lt;/P&gt;&lt;P&gt;rpt1totaltax,&lt;/P&gt;&lt;P&gt;rpt2totaltax,&lt;/P&gt;&lt;P&gt;rpt1rounding,&lt;/P&gt;&lt;P&gt;rpt2rounding,&lt;/P&gt;&lt;P&gt;rpt3rounding,&lt;/P&gt;&lt;P&gt;rtrim(text(rategrpcode)) as 'rategrpcode',&lt;/P&gt;&lt;P&gt;rpt3totaltax,&lt;/P&gt;&lt;P&gt;rpt1ccamount,&lt;/P&gt;&lt;P&gt;rpt2ccamount,&lt;/P&gt;&lt;P&gt;rpt3ccamount,&lt;/P&gt;&lt;P&gt;rpt1ccfreight,&lt;/P&gt;&lt;P&gt;rpt2ccfreight,&lt;/P&gt;&lt;P&gt;rpt3ccfreight,&lt;/P&gt;&lt;P&gt;rpt1cctax,&lt;/P&gt;&lt;P&gt;rpt2cctax,&lt;/P&gt;&lt;P&gt;rpt3cctax,&lt;/P&gt;&lt;P&gt;rpt1cctotal,&lt;/P&gt;&lt;P&gt;rpt2cctotal,&lt;/P&gt;&lt;P&gt;rpt3cctotal,&lt;/P&gt;&lt;P&gt;orderamt,&lt;/P&gt;&lt;P&gt;docorderamt,&lt;/P&gt;&lt;P&gt;rpt1orderamt,&lt;/P&gt;&lt;P&gt;rpt2orderamt,&lt;/P&gt;&lt;P&gt;rpt3orderamt,&lt;/P&gt;&lt;P&gt;rtrim(text(sysrowid)) as 'sysrowid',&lt;/P&gt;&lt;P&gt;sysrevid,&lt;/P&gt;&lt;P&gt;taxpoint,&lt;/P&gt;&lt;P&gt;taxratedate,&lt;/P&gt;&lt;P&gt;rtrim(text(taxregioncode)) as 'taxregioncode',&lt;/P&gt;&lt;P&gt;useots,&lt;/P&gt;&lt;P&gt;rtrim(text(otsname)) as 'otsname',&lt;/P&gt;&lt;P&gt;rtrim(text(otsaddress1)) as 'otsaddress1',&lt;/P&gt;&lt;P&gt;rtrim(text(otsaddress2)) as 'otsaddress2',&lt;/P&gt;&lt;P&gt;rtrim(text(otsaddress3)) as 'otsaddress3',&lt;/P&gt;&lt;P&gt;rtrim(text(otscity)) as 'otscity',&lt;/P&gt;&lt;P&gt;rtrim(text(otsstate)) as 'otsstate',&lt;/P&gt;&lt;P&gt;rtrim(text(otszip)) as 'otszip',&lt;/P&gt;&lt;P&gt;rtrim(text(otsresaleid)) as 'otsresaleid',&lt;/P&gt;&lt;P&gt;rtrim(text(otscontact)) as 'otscontact',&lt;/P&gt;&lt;P&gt;rtrim(text(otsfaxnum)) as 'otsfaxnum',&lt;/P&gt;&lt;P&gt;rtrim(text(otsphonenum)) as 'otsphonenum',&lt;/P&gt;&lt;P&gt;otscountrynum,&lt;/P&gt;&lt;P&gt;totalwhtax,&lt;/P&gt;&lt;P&gt;doctotalwhtax,&lt;/P&gt;&lt;P&gt;rpt1totalwhtax,&lt;/P&gt;&lt;P&gt;rpt2totalwhtax,&lt;/P&gt;&lt;P&gt;rpt3totalwhtax,&lt;/P&gt;&lt;P&gt;totalsatax,&lt;/P&gt;&lt;P&gt;doctotalsatax,&lt;/P&gt;&lt;P&gt;rpt1totalsatax,&lt;/P&gt;&lt;P&gt;rpt2totalsatax,&lt;/P&gt;&lt;P&gt;rpt3totalsatax,&lt;/P&gt;&lt;P&gt;bitflag,&lt;/P&gt;&lt;P&gt;rtrim(text(otssaveas)) as 'otssaveas',&lt;/P&gt;&lt;P&gt;rtrim(text(otssavecustid)) as 'otssavecustid',&lt;/P&gt;&lt;P&gt;otscustsaved,&lt;/P&gt;&lt;P&gt;shiptocustnum,&lt;/P&gt;&lt;P&gt;rtrim(text(orderstatus)) as 'orderstatus',&lt;/P&gt;&lt;P&gt;holdsetbydemand,&lt;/P&gt;&lt;P&gt;inprice,&lt;/P&gt;&lt;P&gt;intotalcharges,&lt;/P&gt;&lt;P&gt;intotalmisc,&lt;/P&gt;&lt;P&gt;intotaldiscount,&lt;/P&gt;&lt;P&gt;docintotalcharges,&lt;/P&gt;&lt;P&gt;docintotalmisc,&lt;/P&gt;&lt;P&gt;docintotaldiscount,&lt;/P&gt;&lt;P&gt;rpt1intotalcharges,&lt;/P&gt;&lt;P&gt;rpt2intotalcharges,&lt;/P&gt;&lt;P&gt;rpt3intotalcharges,&lt;/P&gt;&lt;P&gt;rpt1intotalmisc,&lt;/P&gt;&lt;P&gt;rpt2intotalmisc,&lt;/P&gt;&lt;P&gt;rpt3intotalmisc,&lt;/P&gt;&lt;P&gt;rpt1intotaldiscount,&lt;/P&gt;&lt;P&gt;rpt2intotaldiscount,&lt;/P&gt;&lt;P&gt;rpt3intotaldiscount,&lt;/P&gt;&lt;P&gt;rtrim(text(arlocid)) as 'arlocid',&lt;/P&gt;&lt;P&gt;rtrim(text(ourbank)) as 'ourbank',&lt;/P&gt;&lt;P&gt;ersorder,&lt;/P&gt;&lt;P&gt;lochold,&lt;/P&gt;&lt;P&gt;rtrim(text(pscurrcode)) as 'pscurrcode',&lt;/P&gt;&lt;P&gt;rtrim(text(invcurrcode)) as 'invcurrcode',&lt;/P&gt;&lt;P&gt;rtrim(text(legalnumber)) as 'legalnumber',&lt;/P&gt;&lt;P&gt;rtrim(text(trandoctypeid)) as 'trandoctypeid',&lt;/P&gt;&lt;P&gt;rtrim(text(xrefcontractnum)) as 'xrefcontractnum',&lt;/P&gt;&lt;P&gt;xrefcontractdate,&lt;/P&gt;&lt;P&gt;demandprocessdate,&lt;/P&gt;&lt;P&gt;demandprocesstime,&lt;/P&gt;&lt;P&gt;rtrim(text(lastschedulenumber)) as 'lastschedulenumber',&lt;/P&gt;&lt;P&gt;rtrim(text(lasttctrlnum)) as 'lasttctrlnum',&lt;/P&gt;&lt;P&gt;rtrim(text(lastbatchnum)) as 'lastbatchnum',&lt;/P&gt;&lt;P&gt;progress_recid,&lt;/P&gt;&lt;P&gt;progress_recid_ident_,&lt;/P&gt;&lt;P&gt;rtrim(text(company)) &amp;amp; '-' &amp;amp; ordernum as primarykeyorder&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;SQL SELECT &lt;/P&gt;&lt;P&gt;&amp;nbsp; * &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM epicor905.dbo.orderhed&lt;/P&gt;&lt;P&gt;where voidorder='0'&lt;/P&gt;&lt;P&gt;and ((CAST((&amp;nbsp; STR( ( YEAR(changedate) ) ) + '/' +&amp;nbsp; STR( MONTH(changedate) ) + '/' +&amp;nbsp; STR( DAY(changedate) )&amp;nbsp; ) AS DATETIME) ) &amp;gt;=&lt;/P&gt;&lt;P&gt; CAST((&amp;nbsp; STR( ( $(LastExecTimeyear) ) ) + '/' +&amp;nbsp; STR( ($(LastExecTimemonth)) ) + '/' +&amp;nbsp; STR(($(LastExecTimeday)) )&amp;nbsp; ) AS DATETIME)&amp;nbsp; &lt;/P&gt;&lt;P&gt; AND &lt;/P&gt;&lt;P&gt; (CAST((&amp;nbsp; STR( ( YEAR(changedate) ) ) + '/' +&amp;nbsp; STR( MONTH(changedate) ) + '/' +&amp;nbsp; STR( DAY(changedate) )&amp;nbsp; ) AS DATETIME) ) &amp;lt;=&lt;/P&gt;&lt;P&gt;&amp;nbsp; CAST((&amp;nbsp; STR( ( $(ThisExecTimeyear) ) ) + '/' +&amp;nbsp; STR( ($(ThisExecTimemonth)) ) + '/' +&amp;nbsp; STR(($(ThisExecTimeday)) )&amp;nbsp; ) AS DATETIME) )&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate LOAD &lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FROM [\\server\UpdatedQVD\Orderhead.qvd(qvd)] (qvd)&lt;/P&gt;&lt;P&gt;WHERE NOT EXISTS(primarykeyorder);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inner Join LOAD rtrim(text(company)) as company, ordernum;SQL SELECT company,ordernum FROM epicor905.dbo.orderhed where voidorder='0';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If ScriptErrorCount = 0 then&lt;/P&gt;&lt;P&gt;STORE Order1 into [\\server\UpdatedQVD\Orderhead.qvd(qvd)];&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Order:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;company &amp;amp; '-' &amp;amp; custnum as companycust_X,&lt;/P&gt;&lt;P&gt;company &amp;amp; '-' &amp;amp; custnum as companycustord,&lt;/P&gt;&lt;P&gt;company &amp;amp; '-' &amp;amp; ordernum as companyordernum,&lt;/P&gt;&lt;P&gt;company &amp;amp; '-' &amp;amp; ordernum as companyord,&lt;/P&gt;&lt;P&gt;company as Company1,&lt;/P&gt;&lt;P&gt;ponum as 'Customer PO',&lt;/P&gt;&lt;P&gt;Monthname(orderdate) as 'Month and Year Ordered',&lt;/P&gt;&lt;P&gt;Month(orderdate) as 'Month Ordered',&lt;/P&gt;&lt;P&gt;Year(orderdate) as 'Year Ordered',&lt;/P&gt;&lt;P&gt;Date(orderdate,'MM/DD/YYYY') as 'Order Date',&lt;/P&gt;&lt;P&gt;if(YEAR(orderdate)=Year(today()),if(company='Other',orderamt)) as 'Current Year',&lt;/P&gt;&lt;P&gt;if(YEAR(orderdate)=(Year(today())-1),if(company='Other',orderamt/.8)) as Goal,&lt;/P&gt;&lt;P&gt;'Q' &amp;amp; Ceil(Month(orderdate)/3) as 'Quarter Ordered',&lt;/P&gt;&lt;P&gt;openorder as 'Open Order',&lt;/P&gt;&lt;P&gt;if(WildMatch(salesreplist,'*HOUSE*','*House*'),'House','Non-House') as 'House',&lt;/P&gt;&lt;P&gt;orderamt as 'Order Amount',&lt;/P&gt;&lt;P&gt;If(orderamt&amp;lt;25000,'1. Under 25K',If((orderamt&amp;gt;=25000 and orderamt&amp;lt;50000),'2. 25K–50K',If((orderamt&amp;gt;=50000 and orderamt&amp;lt;100000),'3. 50K to 100K',If((orderamt&amp;gt;=100000 and orderamt&amp;lt;200000),'4. 100K to 200K',If((orderamt&amp;gt;=200000 and orderamt&amp;lt;300000),'5. 200K to 300K',If((orderamt&amp;gt;=300000 and orderamt&amp;lt;400000),'6. 300K to 400K',If((orderamt&amp;gt;=400000 and orderamt&amp;lt;500000),'7. 400K to 500K',if(orderamt&amp;gt;=500000,'8. Over 500K'))))))))as 'Order Level',&lt;/P&gt;&lt;P&gt;ordernum as 'Order Number',&lt;/P&gt;&lt;P&gt;company &amp;amp; '-' &amp;amp; custnum&amp;nbsp; &amp;amp; '-' &amp;amp; shiptonum &amp;amp; '-' &amp;amp; shpconnum as contact1,&lt;/P&gt;&lt;P&gt;requestdate as 'Requested by Date',&lt;/P&gt;&lt;P&gt;Capitalize( SubField(salesreplist,'~',1)) as 'Salesperson SO'&lt;/P&gt;&lt;P&gt;Resident Order1;&lt;/P&gt;&lt;P&gt;DROP Table Order1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 15:09:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439564#M700595</guid>
      <dc:creator />
      <dc:date>2012-10-22T15:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439565#M700596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add the script statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Force Case Lower;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prior to the Load statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 16:56:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439565#M700596</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-10-22T16:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439566#M700597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That saved me probably several hours worth of work, Thank you very much sir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 17:08:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439566#M700597</guid>
      <dc:creator />
      <dc:date>2012-10-22T17:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439567#M700598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;D'Oh!&amp;nbsp; I've even used that one myself previously!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/silly.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 17:12:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439567#M700598</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-10-22T17:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439568#M700599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you need to turn this off after you completed this step?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 17:22:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439568#M700599</guid>
      <dc:creator />
      <dc:date>2012-10-22T17:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439569#M700600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Klangley had a good question, do I need to apply this once at the begining of the document, or before every Load statement that I want it to affect?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 17:28:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439569#M700600</guid>
      <dc:creator />
      <dc:date>2012-10-22T17:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439570#M700601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a directive. It remains in effect until changed by a subsequent FORCE statement. So once is good enough. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See "Force" in the help or Ref Guide for options. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 17:42:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439570#M700601</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-10-22T17:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439571#M700602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does this Force Lower only the field names, or also force lowers the contents of the fields themselves? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need JUST the field names to be lower case, and the contents to be mixed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 20:11:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439571#M700602</guid>
      <dc:creator />
      <dc:date>2012-10-22T20:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439572#M700603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ouch. It does indeed change the &lt;STRONG&gt;values &lt;/STRONG&gt;to lower case as well as the field name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 21:49:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439572#M700603</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-10-22T21:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439573#M700604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob Wunderlich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use Force Case Upper but it doesn't work for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I doing something wrong ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 22:14:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439573#M700604</guid>
      <dc:creator>jeffmartins</dc:creator>
      <dc:date>2012-10-22T22:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439574#M700605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's another solution I've discovered if the FORCE option doesn't suit your needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO {connection}; //or oledb&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQLTableColumns:&lt;/P&gt;&lt;P&gt;load *;&lt;/P&gt;&lt;P&gt;SQLCOLUMNS; //returns info on all poss tables and columns via the connection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Build SQL Commands&lt;/P&gt;&lt;P&gt;//This effectively concatenates a list of all the fields in that table and builds a dynamic select string (limited only to the tables you need by the MATCH command)&lt;/P&gt;&lt;P&gt;SQLSelectCommands:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TABLE_NAME, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Select ' &amp;amp; concat(lower(COLUMN_NAME),',') &amp;amp; ' from ' &amp;amp; TABLE_NAME AS ColList&lt;/P&gt;&lt;P&gt;resident SQLTableColumns&lt;/P&gt;&lt;P&gt;where Match(TABLE_NAME,'{table1}','{table2}','{table3}' ...) &amp;gt; 0&lt;/P&gt;&lt;P&gt;Group By TABLE_NAME;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE SQLTableColumns; //don't need this anymore&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//when you are ready to do the select * command, replace as follows for each table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET cmdSQL = Lookup('ColList', 'TABLE_NAME', '{table}'); // where {table} is your source SQL table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Order1:&lt;/P&gt;&lt;P&gt;LOAD {QV LOGIC as previous}&lt;/P&gt;&lt;P&gt;SQL &lt;STRONG&gt;$(cmdSQL)&lt;/STRONG&gt; where clause ...;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have only tested this briefly, but seems to work.&amp;nbsp; Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT:&amp;nbsp; This works with some drivers and not others.&amp;nbsp; My Informix driver can return either all UPPERCASE or all LOWERCASE by using the FORCE CASE command, but default is lowercase - not mixed - and cannot FORCE mixed, even if ColList above uses column name aliasing.&amp;nbsp; With Microsoft Excel driver though, mixed cases are possible and this works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 09:56:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439574#M700605</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-10-23T09:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Read fields from SQL database with field names lower case only?</title>
      <link>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439575#M700606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With reference to the RENAME fields option I gave earlier, it will generate an error if you attempt to rename a field to the same name, so test for this first to prevent the error ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sub RenameFlds(SQLQuery, qvdName)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL $(SQLQuery);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For f = 1 to NoOfFields('tmp')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vFieldOld = FieldName($(f),'tmp');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vFieldNew = Lower('$(vFieldOld)');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If $(vFieldNew) &amp;lt;&amp;gt; $(vFieldOld) then&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RENAME FIELD $(vFieldOld) to $(vFieldNew);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next f;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; STORE tmp INTO '$(tblName)'.qvd (qvd);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DROP Table tmp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;end sub&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the code above I have placed the logic into a sub routine to create a temp qvd within the load script which can then be called multiple times as follows ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET SQLcmd = 'SELECT * FROM {tbl}';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CALL RenameFlds('$(SQLcmd)','Order1');&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 10:03:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-fields-from-SQL-database-with-field-names-lower-case-only/m-p/439575#M700606</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-10-23T10:03:18Z</dc:date>
    </item>
  </channel>
</rss>

