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...
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
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...
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...
...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] Like...
...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)
----------
2. I was using "LIKE" to mimic what I had written when I wrote a condition using a...
...my query I will have 5 different statements similiar to one below)
AdjACond: IIf ([Forms]![frmSubject]![Cond] Like ‘A’, IIf ([Cond] Like ‘E’, -.20 * [SalePrice], IIF ([Cond] Like ‘G’, -.10 * [SalePrice], IIF ([Cond] Like ‘A’, 0, IIF ([Cond] Like ‘F’, .10 * [SalePrice], IIF ([Cond] Like ‘P’...
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" & _
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" & _
...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?
strSQL="SELECT MyTable.Nbhd FROM MyTable " & _
"WHERE ((MyTable.Nbhd) Like Left(([Forms]![frmMyForm]![Nbhd],1))& "*");
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...
...works in SQL view of my query. But I want to convert to VBA and have it populate a query so that it processes quicker.
How would I do that?
**********
Set TopThree = CurrentDb.CreateQuerydef("TopThree")
strSQL = SELECT TOP 3 INSERT INTO TopThree(query)......????
**********
I am having a...
...Temp.RecordID FROM Temp WHERE Temp.RecordID = 5 and Temp.Property not in (Select Temp.Property FROM Temp WHERE Temp.RecordID < 7)]. AS [TopThree]
'*** This is where I want to say,,,,
WHERE Row ID <4 or TOP (3) I need the right Syntax???*****
ORDER BY [Temp].[RecordID], [Temp].[Property];
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...
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.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.