I don't know what the DoubleMetaphone() function does, but I think you can modify its code to first accept the FirstName as text and convert it into an array pWord. Something like...
Public Function DoubleMetaphone(FName As String, MetaPh, MetaPh2) As Boolean
Dim pWord()
Dim i As Integer...
Private Sub txtQuery_Click()
On Error GoTo Err_txtQuery_Click
Dim strSQL As String
Dim strWHERE As String
strSQL = "SELECT * from Panel"
If Not IsNull(Me.qMO) Then
strWHERE = " AND [MO] = " & Me.qMO
End If
If Not IsNull(Me.qCode) Then
strWHERE = strWHERE & "...
Access treats what is returned by the function as one whole value. Hence it will work when the function returns one number e.g. 2, but when more than one numbers are returned e.g. 2 or 3 or 5, it will not work.
There is a workaround. You can use a built-in function in the Where Clause of the...
The fastness of Query2 above for getting a list of "only mixed credits and invoices" has led me to rethink the issue and arrive at using it to retrieve lists of "credits only" and "invoices only".
qryCredits only:-
SELECT DISTINCT [TableName].[account number]
FROM [TableName] LEFT JOIN Query2...
To get a list of only mixed credits and invoices, you can use two Totals Queries:-
Query1:-
SELECT [account number], type
FROM [TableName]
GROUP BY [account number], type
Query2:-
SELECT [account number]
FROM Query1
GROUP BY [account number]
HAVING Count([account number])=2
Run Query2...
Assuming you have a Shift field storing the numbers 1, 2 or 3 for each record, you can use the InStr() function in the SQL View of the query like this:-
SELECT *
FROM [TableName]
WHERE InStr([Enter shift number 1, 2, or 3 to view shift], [Shift]);
.
The slowness is caused by Distinct and the inefficient Not In.
Sometimes indexing the necessary fields and splitting a query into two and linking them with a join may help speed it up.
In table design, index the account number field and the type field. Then try these two queries.
qryOne:-...
See the attached database, which contains a table with these records:-
account number type
111111 credit
222222 invoice
222222 credit
222222 credit
333333 credit
444444 credit
444444 credit
When the query is run, it returns these three account numbers:-
account number
111111
333333
444444
So...
What you need is an outer join, not the Nz() function.
In query Design View, double click the line joining the two tables. In the dialog that pops up, choose the option that includes all records from the transactions table.
.
Try this query.
SELECT DISTINCT [account number]
FROM [TableName]
WHERE [account number] not in (Select [account number] from [TableName] where type<>"Credit");
.
To deal with empty exit dates, you can use the Nz() function.
If by Exit Date you mean the contract end date 30-10-2007 i.e. the last date of employee, the following query should do the job:-
PARAMETERS [Enter start date] DateTime;
SELECT *
FROM [TableName]
WHERE [Entry Date]<=[Enter end...
You can do it in two steps.
First, build a Totals Query from your table, Group By UPC and get the Min value of [MinOfAverage Unit Cost].
qryOne:-
SELECT UPC, Min([MinOfAverage Unit Cost]) AS MinCost
FROM [TableName]
GROUP BY UPC;
Then join the query back to the table in a second query to...
I have both IE6 and Firefox on my system, which is rather old. I have installed the IE Tab extension (add-on?) in FF for going to M$ sites or sites that specifically require IE. Though FF has become my favourite because of its speed and tab windows, I still have to keep IE6 because it's part of...
The A2007 help in the attached doc is the same as my A2003 help
(except for the spelling of one word: updateable vs updatable.)
It's odd -- both words are displayed as correct in Word 2003 but both are underlined in red when typing this message in Firefox.
.
Try this query:
SELECT T.Ticker, Sum(T.Quantity) AS SumOfQuantity,
(Select Top 1 [Stop] from [tblStops] where [Ticker]=T.[Ticker] and [Date]<=#4/13/2007# Order By [Date] desc) AS Stop
FROM tblTransactions AS T
WHERE Date<=#4/13/2007#
GROUP BY T.Ticker
HAVING Sum(Quantity)>0
Note:
Date is...
You need to declare the data type of the two parameters for the crosstab.
Open the query that contains Forms!NameOfForm!StartOfDateField and Forms!NameOfForm!EndOfDateField in query design view. Choose menu Query, Parameters...
In the dialog that pops up, type the two parameters in the left...
Sometimes there are more than one way to achieve the same results.
If you build the query in query Design View in the same way as in my post above, the True should work. You can see my sample database in the link in my earlier post as well as the database attached in post #4 in this thread:-...