Shape command with Where clause - InfoPath Dev
in

InfoPath Dev

Shape command with Where clause

Last post 01-31-2008 04:50 AM by m181354. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-30-2008 03:03 PM

    Shape command with Where clause

     Does anyone know how to use the where clause with the shape clause? I get a error on the following code at the Where clause.... 

     

     command += "{select ";

    command += "[CA1],[HOUR_DOLLAR],[DIST_NONDIST],[MASTER],";

     command += "[PROGRAM],[PROG_DESC],[BUY_OFF_MONTH],[CAM],[ANALYST],";

     command += "[WBS],[OBS],[ECAM],[APPROVED_SIGNED],";

    command += "[SV_HRS],[CTD_EAC_HRS],[CTD_ACWP_HRS],[BUY_OFF_DELTA_HRS],";

    command += "[WAS_ETC_HRS],[NOW_ETC_HRS],[DELTA_ETC_HRS],";

    command += "[WAS_EAC_HRS],[NOW_EAC_HRS],[EAC_DELTA_HRS],";

    command += "[SV_DOL],[CTD_EAC_DOL],[CTD_ACWP_DOL],[BUY_OFF_DELTA_DOL],[WAS_ETC_DOL],";

     command += "[NOW_ETC_DOL],[DELTA_ETC_DOL],[WAS_EAC_DOL],[NOW_EAC_DOL],[EAC_DELTA_DOL] ";

    command += "from "; command += "[LaborSummary]} as [LaborSummary] ";

    command += "where (LaborSummary.[CA1] = '" + ca1Prefix + "') ";

    command += "append ";

     command += "({select ";

    command += "[CA1],[HOUR_DOLLAR],[BE],[DATE],[DISTR_HRS],[DISTR_DOL] ";

    command += "from ";

    command += "[DistributedRecords] as [DistributedRecords]} as [DistributedRecords]";

    command += "relate [CA1] to [CA1],[HOUR_DOLLAR] TO [HOUR_DOLLAR]) as [DistributedRecords] ";

    command += "order by DistributedRecords.[CA1], DistributedRecords.[BE], DistributedRecords.[DATE] ";

  • 01-30-2008 03:20 PM In reply to

    • djay
    • Top 500 Contributor
    • Joined on 06-06-2006
    • Posts 35

    Re: Shape command with Where clause

    I'm not a SQL expert, but I believe you need the } after the where clause.  So I would have:

    ...from "dbo"."LaborSummary" as "LaborSummary" where "SA1" = "whatever"} as "LaborSummary" append...

  • 01-31-2008 04:50 AM In reply to

    Re: Shape command with Where clause and Order By clause

    That worked great!  Thanks   Now what about the Order By clause?  I get an error with the below code on the Order By clause.

     

     command += "{select * ";

    command += "from ";

    command += "[LaborSummary] as [LaborSummary] ";

    command += "where (LaborSummary.[CA1] = '" + ca1Prefix + "')} ";

    command += "append ";

     command += "({select * ";

    command += "from ";

    command += "[DistributedRecords] as [DistributedRecords]}";

     command += "relate [CA1] to [CA1],[HOUR_DOLLAR] TO [HOUR_DOLLAR]) as [DistributedRecords] ";

    command += "order by DistributedRecords.[CA1], DistributedRecords.[BE], DistributedRecords.[DATE]";

     

     

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.