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 Mike Lewis 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. cwadams

    ASP + Recordsets + SQL

    Thanks it works like a charm.
  2. cwadams

    ASP + Recordsets + SQL

    I am a newbie to ASP and am trying to learn. In my ASP page I have 2 SQL Select Statements. I am passing a value (4+)that is stored in my (SubRs "Class")recordset to the 2nd SQL statement, but I want to extract only the first character and then add a wildcard. So that I can extract all...
  3. cwadams

    Nested IIF's with conditional statement in Query

    I was not aware that you cannot copy from WORD to Access. PHV & dhookom "You are both 'right'" I learned a valuable lesson here. Don't use WORD. You both get a star for fast response and valuable post to me. Thanks After 3 days.....Saved my weekend, thanks
  4. cwadams

    Nested IIF's with conditional statement in Query

    dhookom- Let's say, I have a "Subject" it is in "Avg" condition. I have 3 comparables to that subject, in some sort of Condition. "avg","fair","Poor","excellent". If my subject is in Avg cond and my comparable is in poor condition then calculate a percentage. If comparable is in Excellent then...
  5. cwadams

    Nested IIF's with conditional statement in Query

    This is the code that I Type in query: AdjACond: IIf ([Forms]![frmSubject]![Cond] = ‘A’, IIf ([Cond] = ‘E’, -.20 * [SalePrice], IIF ([Cond] = ‘G’, -.10 * [SalePrice], IIF ([Cond] = ‘A’, 0, IIF ([Cond] = ‘F’, .10 * [SalePrice], IIF ([Cond] = ‘P’, .20 * [SalePrice],0)))))) However when I run the...
  6. cwadams

    Nested IIF's with conditional statement in Query

    SELECT qryTopThree.RecordID, IIf([Forms]![frmSubject]![Cond]=[“A”],IIf([Cond]=[“E”],-0.2*[SalePrice], IIf([Cond]=[“G”],-0.1*[SalePrice],IIf([Cond]=[“A”],0,IIf([Cond]=[“F”],0.1* [SalePrice],IIf([Cond]=[“P”],0.2*[SalePrice],0)))))) AS AdjACond FROM qryTopThree; ************************* I was...
  7. cwadams

    Nested IIF's with conditional statement in Query

    MY SQL view Code: SELECT TOP 3 Temp.RecordID AS RecordID, Temp.Cond AS Cond, Temp.FirstFourSeg AS FirstFourSeg, IIf([Forms]![frmSubject]![FirstFourSeg] Like '*bsm*',IIf([FirstFourSeg] Like '*bsm*',0,10000),0) AS AdjBSMSub, IIf([FirstFourSeg] Like '*bsm*',IIf([Forms]![frmSubject]![FirstFourSeg]...
  8. cwadams

    Nested IIF's with conditional statement in Query

    1. Single quotes work. Double quotes DO NOT in the statement below that I wrote in a Query.My belief was that you were SUPPOSED to use double quotes.Double don't work below. ---------- AdjBSMSub: IIf([Forms]![frmSubject]![FirstFourSeg] Like '*bsm*',IIf([FirstFourSeg] Like '*bsm*',0,10000),0)...
  9. cwadams

    Nested IIF's with conditional statement in Query

    I want to compare two values. The value that is on my form and the value(s) that are in the query. Ex: "If Value on form for [Cond] is "A" and true; & value for that field in the query is: E, G, A, F, or P. I want to calculate a value. There are 5 different values that can be on Form. E,G,A,F,P...
  10. cwadams

    Passing a Wildcard

    I tried your line of code and it kept erroring out and saying data mismatch. So I used a single quote around wildcard and it works. Thanks for the quick reply and helpfulness. I was running out of ideas. "((CompSales.Nbhd) Like (Left([Forms]![frmSubject]![Nbhd], 1) & '*' )) AND" & _
  11. cwadams

    Passing a Wildcard

    Silly me. " vs '
  12. cwadams

    Passing a Wildcard

    When I have my original line it works with no error reporting. "Where " & _ "((CompSales.Nbhd) Like [Forms]![frmSubject]![Nbhd]) AND" & _ But the new line crashes and reports: type mismatch "Where " & _ "((CompSales.Nbhd) Like (Left([Forms]![frmSubject]![Nbhd], 1) & " * " )) AND" & _
  13. cwadams

    Passing a Wildcard

    When I write the above code I get a Err # 13 Type Mismatch error. solution?
  14. cwadams

    Passing a Wildcard

    I am using Access2003 and in VBA I have a NBHD of RJA. In the condition of my query,I want to query from the table all NBH that are like the first character that matches frmMyForm.NBH So I want to see all NBH that start with the letter R, regardless of length. Suggestions for the syntax...
  15. cwadams

    Grab first 3 records

    Set TopThree = CurrentDb.CreateQuerydef("TopThree") strSQL = SELECT TOP 3 INSERT INTO TopThree(query)......???? Not to offend. This is not my code. I was trying to be descriptive in what I wanted. Let me try something different..... 'Code is below Set TopThree = currentDb..createQuerydef...
  16. cwadams

    Grab first 3 records

    SELECT TOP 3 [Temp].[RecordID] AS RecordID, [Temp].[Property] AS Property FROM [Select Temp.Property, Temp.RecordID FROM Temp WHERE Temp.RecordID = 1 Union.................... Thanks Alexcuse!!! It works!!!This works in SQL view of my query. But I want to convert to VBA and have it populate a...
  17. cwadams

    Grab first 3 records

    Here is my example: SELECT [Temp].[RecordID] AS RecordID, [Temp].[Property] AS Property FROM [Select Temp.Property, Temp.RecordID FROM Temp WHERE Temp.RecordID = 1 Union Select Temp.Property, Temp.RecordID FROM Temp WHERE Temp.RecordID = 2 and Temp.Property not in (Select Temp.Property FROM...
  18. cwadams

    Grab first 3 records

    I am going to populate my report from the table or query I create using the TOP 3 records. Backtrack: I have a table with let's say 68 records. After running a union query....Using SQL I am now left over with 5 unique PropID with a value or star rating in the RecordID field. For Example: propid...
  19. cwadams

    Grab first 3 records

    I have a tblTemp with 2 fields PropID, and RecordID I can have many records but I want to always grab the first 3 records and pass to a report. Any suggestions on the syntax for this VBA code? I know that SQL uses TOP (3) but I cannot find a reference to this using Access.mdb and VBA.
  20. cwadams

    Creating a Make-Table Query in VBA

    Yes and Yes. I needed to execute the SQL AND I needed to add a "little space" after the quotes in my string statement. Program has passed this phase on to the next hurdle. Thanks all.

Part and Inventory Search

Back
Top