Hi All,
Here is my SQL data query and I have Start Date, End Date and FTP Date as arguments. I am trying to get the FTPDATE argument to be used in my file naming convention when stored locally (highlighted in RED). Everything works except naming the file.
Any help will be greatly appreciated.
dim connectionString as c
connectionString = "{A5API='SQLServer',A5DBVersion=2005,Server='BCOSQL02',Trusted_connection=yes,Database='DialerData_PROD_01'}"
delete options
dim options as p
options.ConsolidateArguments= .f.
options.AddTablesToDatabase= .t.
options.ShowProgress= .t.
options.AllowCancel= .t.
delete a_import
dim a_import[0] as p
a_import[].ObjectName = "<Custom SQL Query>"
a_import[..].SQLSelectStatement = "SELECT c.Brand, c.FirstName, c.LastName, c.City, c.State, c.Zip, c.Phonenumber, c.flag, c.agent_firstname, c.agent_lastname, c.contact_id, c.CCN, c.q2, c.q7a FROM pmusa c INNER JOIN i3_PMUSA_ch0 h ON c.i3_rowid = h.i3_rowid WHERE (c.ContactDispo = 'success') AND (h.finishcode = 'success') AND h.callplacedtime BETWEEN :startdate AND :enddate UNION SELECT c.Brand, c.FirstName, c.LastName, c.City, c.State, c.Zip, c.Phonenumber, c.flag, c.agent_firstname, c.agent_lastname, c.contact_id, c.CCN, c.q2, c.q7a FROM PM_Revision c INNER JOIN i3_PM_Revision_ch0 h ON c.i3_rowid = h.i3_rowid WHERE (c.ContactDispo = 'success') AND (h.finishcode = 'success') AND h.callplacedtime BETWEEN :startdate AND :enddate"
a_import[..].SQLType = "Native"
a_import[..].Arguments = <<%txt%
<Arguments<[1]<variablename="startdate">
<prompt="startdate">
<type="Date">
<style="Calendar">
<default_value="">
<helptext="">
<choices="">
<maximumvalue="">
<minimumvalue="">
>
<[2]<variablename="enddate">
<prompt="enddate">
<type="Date">
<style="Calendar">
<default_value="">
<helptext="">
<choices="">
<maximumvalue="">
<minimumvalue="">
>
<[3]<variablename="ftpdate">
<prompt="ftpdate">
<type="Date">
<style="Calendar">
<default_value="=date()">
<helptext="">
<choices="">
<maximumvalue="">
<minimumvalue="">
>
>
<DialogTitle="Specify Argument Values">
<OKButtonLabel="&OK">
<CancelButtonLabel="&Cancel">
%txt%
a_import[..].ImportType = "Create ASCII file"
a_import[..].LocalFileName = a5.get_path() + chr(92) + "acc_output_"+:FTPDATE+ ".txt"
dim flagSilent as l
flagSilent = .f.
delete args
dim args as sql::arguments
delete p
dim p as p
p = a5_AlphaDAO_Import(connectionString,a_import,options,flagSilent,args)
Here is my SQL data query and I have Start Date, End Date and FTP Date as arguments. I am trying to get the FTPDATE argument to be used in my file naming convention when stored locally (highlighted in RED). Everything works except naming the file.
Any help will be greatly appreciated.
dim connectionString as c
connectionString = "{A5API='SQLServer',A5DBVersion=2005,Server='BCOSQL02',Trusted_connection=yes,Database='DialerData_PROD_01'}"
delete options
dim options as p
options.ConsolidateArguments= .f.
options.AddTablesToDatabase= .t.
options.ShowProgress= .t.
options.AllowCancel= .t.
delete a_import
dim a_import[0] as p
a_import[].ObjectName = "<Custom SQL Query>"
a_import[..].SQLSelectStatement = "SELECT c.Brand, c.FirstName, c.LastName, c.City, c.State, c.Zip, c.Phonenumber, c.flag, c.agent_firstname, c.agent_lastname, c.contact_id, c.CCN, c.q2, c.q7a FROM pmusa c INNER JOIN i3_PMUSA_ch0 h ON c.i3_rowid = h.i3_rowid WHERE (c.ContactDispo = 'success') AND (h.finishcode = 'success') AND h.callplacedtime BETWEEN :startdate AND :enddate UNION SELECT c.Brand, c.FirstName, c.LastName, c.City, c.State, c.Zip, c.Phonenumber, c.flag, c.agent_firstname, c.agent_lastname, c.contact_id, c.CCN, c.q2, c.q7a FROM PM_Revision c INNER JOIN i3_PM_Revision_ch0 h ON c.i3_rowid = h.i3_rowid WHERE (c.ContactDispo = 'success') AND (h.finishcode = 'success') AND h.callplacedtime BETWEEN :startdate AND :enddate"
a_import[..].SQLType = "Native"
a_import[..].Arguments = <<%txt%
<Arguments<[1]<variablename="startdate">
<prompt="startdate">
<type="Date">
<style="Calendar">
<default_value="">
<helptext="">
<choices="">
<maximumvalue="">
<minimumvalue="">
>
<[2]<variablename="enddate">
<prompt="enddate">
<type="Date">
<style="Calendar">
<default_value="">
<helptext="">
<choices="">
<maximumvalue="">
<minimumvalue="">
>
<[3]<variablename="ftpdate">
<prompt="ftpdate">
<type="Date">
<style="Calendar">
<default_value="=date()">
<helptext="">
<choices="">
<maximumvalue="">
<minimumvalue="">
>
>
<DialogTitle="Specify Argument Values">
<OKButtonLabel="&OK">
<CancelButtonLabel="&Cancel">
%txt%
a_import[..].ImportType = "Create ASCII file"
a_import[..].LocalFileName = a5.get_path() + chr(92) + "acc_output_"+:FTPDATE+ ".txt"
dim flagSilent as l
flagSilent = .f.
delete args
dim args as sql::arguments
delete p
dim p as p
p = a5_AlphaDAO_Import(connectionString,a_import,options,flagSilent,args)
Comment