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 bkrike 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: *

  1. wvandenberg

    Prefix first Column Header with #

    I have a stored procedure that builds a dynamic query. I would like to prefix the first column header with a pound sign (#) but the following does not include the # in the final SQL string. Please note that the first colomn is intended to be filled with an empty string. Current select portion...
  2. wvandenberg

    NotInList Selects Different Page on Tab Control

    Hello Everyone, I am having trouble with code for a NotInList event. Here are the details of my form. I have a main form (frmMain) with a tab control (tabMain). On Page1 of tabMain, I have a subform. In the subform I have a bound combo box (cboClient). I am trying to capture the NewData...
  3. wvandenberg

    Item to append containing square brackets not appending

    Hi all, I have a query that checks one table against another then appends any missing items. However, if a missing item contains square brackets (eg. Benzo[e]pyrene), then it is not recognized as "missing". Could anyone suggest how to fix this problem? Here is the SQL: INSERT INTO...
  4. wvandenberg

    Data type mismatch in crosstab

    Hi all, I have a crosstab query TRANSFORM Max(IIf([P_GroupID]=7,IIf([Symbol]=">",Replace([ResultCALC],"-",[Symbol],1,1),Val([ResultCALC])),Val([ResultCALC]))) AS Result SELECT qselWizExpResults2Sort.P_Analyte AS Analyte, qselWizExpResults2Sort.P_Group AS [Group], qselWizExpResults2Sort.Unit...
  5. wvandenberg

    Undo Togglebutton click

    Hi all, I have a toggle button and have implemented the following code in the BeforeUpdate event: Private Sub tglDate_BeforeUpdate(Cancel As Integer) If Not ApplyCriteria Then Me.tglDate.Undo Cancel = True End If End Sub The problem is that the togglebutton stays...
  6. wvandenberg

    Query performance slow

    Hi all, Just wondering if anyone may be able to suggest a way of making this query run faster? SELECT DISTINCT Month(Nz([StartDate],0)) AS Expr1, MonthName(Month(Nz([StartDate],0))) AS Expr2 FROM tblSamples WHERE (((InStr("," & [TempVars]![Samples] & ",","," & [pkSampleID] & ","))>0)) ORDER BY...
  7. wvandenberg

    Select query using TempVars as criteria

    Hi all, I have a select query where I use a TempVar item as the criteria. SELECT tblSamples.SampleName, tblSamples.pkSampleID FROM tblSamples WHERE tblSamples.pkSampleID In ([TempVars]![Samples]); [TempVars]![Samples] contains a string and tblSamples.pkSampleID is a long integer. Possible...
  8. wvandenberg

    Update foreign key of duplicate records

    Hello, I have modified the structure of my database a little bit and now I am faced with removing duplicate records from a table. The two tables I'm working with are joined 1(tblAnalytes.pkAnalyteID)-to-many(tblResults.fkAnalyteID) as described below: tblAnalytes tblResults...
  9. wvandenberg

    Rewrite SQL to make query faster?

    Morning, I have this query that works correctly. INSERT INTO tblWizTempALS ( SAMPLENUM, CLIENTID, MATNUM, SMPDATE, PCODE, METHOD, ANALYTE, RESULT, ResultFixed, Symbol, UNITS, QUALIFIER, RComments ) SELECT tblWizTempWDS.SAMPLE_NO, tblWizTempWDS.STATION_NO, tblWizTempWDS.SAMPLE_MATRIX_CODE...
  10. wvandenberg

    Crosstab query headers are duplicated

    Hello, I have a crosstab that uses a date field [StartDate] as the column heading. The query displays the correct values in each column. However, sometimes [StartDate] contains the time and sometimes it does not. This is causing two separate columns, one for just the date and one for the...
  11. wvandenberg

    Really slow query

    I have a query that is really slow and I was wondering if I can tweak the SQL somehow to speed it up. SELECT DISTINCT A.pkSiteID, A.SiteNameDescription, A.Easting, A.Northing, A.SiteName, A.WaterUnit, A.WaterUnitType, A.Parent FROM tblWizTempALS, [SELECT pkSiteID, SiteName...
  12. wvandenberg

    Ignore queries with missing fields when union query runs

    Hi all, I have 8 queries that are all based on one crosstab query. Each of the 8 queries uses a couple different fields from the underlying crosstab query. I also have a union query that joins all eight of the queries into one. Sometimes one or more of the 8 queries fails because the required...
  13. wvandenberg

    Call Form_Load from another form

    Hi all, I have two forms, FormA and FormB and Form A has a treeview control and two listviews. I open FormB with a button on FormA. I enter data into FormB and when it closes I set the focus back to FormA. I am trying to reload the treeview when I set the focus back to FormA so it reflects the...
  14. wvandenberg

    Display negative value as <

    Hi all, I have a report displaying data with up to 6 decimal places. The values can be either positive or negative. I would like to display all the negative values with a "<" sign rather than a "-" sign. Here is a sample of the unformatted data -0.00005 -0.0001 -5 97 -0.0004 8.2 14 -200 36.2...
  15. wvandenberg

    Select all &quot;parents&quot; of a child from self referencing table

    I have a self referencing table and I am trying to collect the selected record and all the records that are above it until I reach a ParentID that is null. The child could be at any level. For example: pkWaterUnitID,WaterUnit,ParentID 89,Wapasu Creek,79 <---Selected record 108,Wabasca...
  16. wvandenberg

    Global NotInList Event for Unbound Subform

    I am building a custom wizard and am trying to implement faq702-5205 GLOBAL Not In List Event Handler. However, I am getting the error: "Run-time error '2465' ...can't find the field 'sfrImportWizardPage1' referred to in your expression." on the following line: Set sfrm1 =...
  17. wvandenberg

    Crosstab query calculation for each pair of columns

    I was wondering if this is even possible before I keep trying to make it work. I have a crosstab query that looks like this (I left out some of the columns for simplicity as you will see from the SQL): Parameter NC23 (May-30) NC23D (May-30) SC16 (Jun-01) SC16D (Jun-01) Colour...
  18. wvandenberg

    Correct query SQL?

    I have tblSamples containing data about samples collected from specific sites. tblSamples looks like: pkSampleID fkSiteID SampleName SampleDate Round 1787 598 WE73 15/03/2007 1 1786 597 WE71 15/03/2007 1 745 411 WE66...
  19. wvandenberg

    Refresh form after combo NotInList event

    Hi all, I have a form (frmAddNewClient) that contains a combobox (cboClientName) and a subform (sfrAddNewProject). If the desired client is not in the list, the NotInList event fires and the new data is added. Private Sub cboClientName_NotInList(NewData As String, Response As Integer) If...
  20. wvandenberg

    Which query design is better?

    I have two queries: query1 SELECT DISTINCT tblImportALS.ANALYTE, tblAnalytes.AnalyteName, tblGroups.GroupDescription, tblReportingUnits.ReportingUnitsDescription, tblAnalytes.pkAnalyteID, tblAnalytes.ParentAnalyteID FROM tblImportALS INNER JOIN (tblReportingUnits INNER JOIN (tblAnalytes...

Part and Inventory Search

Back
Top