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...
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]...
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)...
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...
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" & _
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...
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...
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...
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...
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.