Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: zimmer9
  • Content: Threads
  • Order by date
  1. zimmer9

    Dynamic SQL ?

    I have a query that will create a report. The SQL statements that comprise this query are a series of 5 Union statements broken out by date ranges. The last part of each of the SQL statements in each of the Unions are as follows: The first union is for a date range within the last 6 months...
  2. zimmer9

    SQL UNION

    I created 5 SELECT UNION statements as follows. I created 1 aggregate record per Customer Number to get their total MarketValue/Cash value (the sum of 2 separate fields). The reason I used a Union was because ultimately I will be creating an Aging report that breaks down into different time...
  3. zimmer9

    Problem with Count in SQL/Distinct Count

    I ran the following query and got the result set which I will split into 2 sections below: SELECT C.CustomerNumber, C.DateLost, IIf(Sum(Nz(P.MarketValue,0)+Nz(P.CashBalance,0))<1000,"L1") AS CAT1, IIf(Sum(Nz(P.MarketValue,0)+Nz(P.CashBalance,0)) Between 1000 And 9999.99,"L2") AS CAT2...
  4. zimmer9

    Query vs. Subquery

    I run the following query named Query5 and get the results that follow: SELECT C.CustomerNumber, C.DateLost, Sum(Nz(P.MarketValue,0)+Nz(P.CashBalance,0)) AS TOTAL, "LT6" AS AGE FROM tblCustomers AS C INNER JOIN tblProducts AS P ON C.CustomerNumber = P.CustomerNumber WHERE (((C.DateLost) Between...
  5. zimmer9

    SQL Aggregate function

    I executed the following query: SELECT tblCustomers.CustomerNumber, tblCustomers.DateLost, , tblProducts.MarketValue, tblProducts.CashBalance FROM tblCustomers INNER JOIN tblProducts ON tblCustomers.CustomerNumber = tblProducts.CustomerNumber GROUP BY tblCustomers.CustomerNumber...
  6. zimmer9

    SQL STATEMENT

    My goal is to create the following 2 Aging report formats: Report As of 2/16/2005 (Date range is 8/1/2004 to 1/31/05) Less Than 6 Months Old # of Accounts ACCT VALUE ------------------------- ------------- ---------- 100K and Above 50 K up to less than 100K under...
  7. zimmer9

    Multiselect Listbox Potential Error

    I have 2 listboxes on a form from which the user can make a selection of state codes. I have set up 2 radio buttons adjacent to the listboxes to allow the user to toggle between these 2 listboxes. One of the listboxes sits on top of the other (superimposed) because I wanted to have the listbox...
  8. zimmer9

    Status Bar traffic lights

    I just added a Microsoft StatusBar Control (ActiveX Control version 6.0 (class MSComctlLib.SBarCtrl.2) to the bottom of 1 of my forms. How would I go about getting traffic light picture icons and paint the status bar red, yellow or green. I wanted to make the status bar green for informational...
  9. zimmer9

    Listbox Creation

    Suppose you want to provide a user with a list box in which the choices are the current year, up to 10 prior years and up to 10 future years. In other words, the choices in the list box should be 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005, 2004, 2003, 2002, 2001, 1999...
  10. zimmer9

    Running a dynamic query from a string variable

    I execute the following sub procedure to generate a report in Excel based on a query I created via the Objects list Query using QBE. Is there a way to run a similar function to take a string I created which I will call strDynamicSQL. This string contains a SQL statement based on listbox values...
  11. zimmer9

    Date variable

    I am trying to write Dynamic SQL chunks of code in a form class module. I have a listbox representing YEARS, which is populated with the following values (established by the user, not me). Listbox Value for YEARS: ----------------------------------- ALL - value needs to be translated into...
  12. zimmer9

    defining tables in VBA

    I was trying to attach code to the On Click event of a Command Button of a Form. When the Command Button is clicked, I wanted to write Dynamic SQL so that I could execute a query based on the values that the user entered into list boxes on the form. The VBA code I started to write is as...
  13. zimmer9

    Run query as 1 query or as 2 queries ?

    I am working with 3 tables as follows: 1)Customer 2)Products 3)States Each customer can have multiple products. Each customer record has a Date Lost field representing the date that the customer last laid claim to the products that he or she owns. These products are deemed Abandoned Property...
  14. zimmer9

    MultiSelect ListBox

    I have a list box for States of the U.S. and 2 associated option buttons. The option buttons were meant to toggle the Multiselect property of the listbox between Multiselect None or Simple. One option button which I made the default is labeled as Group By (the choices are ALL, Group A states...
  15. zimmer9

    Date format

    I created the following in the qbe grid for a criteria and it works fine. How would I modify the 3rd parameter so that Cdate returns 12/31/2004 instead of it's present return value of 12/31/2005. for ex: assume the field Stocks = 3 in the following function...
  16. zimmer9

    Error 3464 on a query execution

    In the QBE grid, I defined the following field: Field: Check/Cert:Format(nz([SharesAmt],[CashBal],'#.000') In the criteria for this field I defined the following: > tblState.Aggreg The idea was place into the Check/Cert field, the contents of either the field SharesAmt or CashBal. Either the...
  17. zimmer9

    Creation of a Status Bar on a form

    I was thinking of creating a Status Bar at the base of a form. Would a status bar have to be created at the time a form is created or can it be added on after the form has already been created ? Could you tell me how to create a Status Bar ? My intent is to use the Status Bar to send messages...
  18. zimmer9

    QBE field formatting

    I have 2 fields that I want to concatenate (and remove the high order position of 1 of these fields) and display them as 1 composite field with a different field name on a report. For example: I have a field named OfficeNumber and a field named CustomerNumber. Office Number has a value of...
  19. zimmer9

    Form Design

    I wanted to create a state form that would allow the user to edit the records (add, change, delete functionality) of 1 table. This State table has 50 rows for the 50 states. It has fields for the State code, a field with a dollar amount and 3 fields that would have integer values. An example...
  20. zimmer9

    Passing a SQL statement to a recordset

    I created a query in Access using the QBE grid. Then I wanted to pass a string containing the SQL code into a Recordset. Therefore, I ran the query, went into SQL view and cut and paste the generated SQL code into a string variable named strFSSQL. The SQL code was a lengthly statement so I split...

Part and Inventory Search

Back
Top