Top 5 Speed Figures Per Entrant

Apr 23, 2007

I have a query which returns each entrant with the speed figures in a descending order for previous races, I wish my query to return the top 5 speed figures per entrant or if the entrant has less than 5 previous runs it needs to return all available data.

I am not VBA literate, so as simple as possible please, thanks.

Freddy67

View Replies


ADVERTISEMENT

Converting Figures To Words

Jul 6, 2006

Dear all,

I am creating a database which has an invoice printing form. In that I would like to have a column for the total amount in words. I have got a sample module from northwind database. According to that 100,000 is "one hundred thousand" but in my country that is pronounced as " 1 Lakh" and for one million it is 10 lakh, for 10 million it is 1 crore like that. Is that possible to change the code in that module to display the words according to our standards? I am attaching the code with this thread. If anybody can show how to do that...I will be thankful to them..


Thanks


Function ConvertCurrencyToEnglish(ByVal MyNumber)
Dim Temp
Dim Dollars, Cents
Dim DecimalPlace, count

ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "

' Convert MyNumber to a string, trimming extra spaces.
MyNumber = Trim(Str(MyNumber))

' Find decimal place.
DecimalPlace = InStr(MyNumber, ".")

' If we find decimal place...
If DecimalPlace > 0 Then
' Convert cents
Temp = Left(Mid(MyNumber, DecimalPlace + 1) & "00", 2)
Cents = ConvertTens(Temp)

' Strip off cents from remainder to convert.
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If

count = 1
Do While MyNumber <> ""
' Convert last 3 digits of MyNumber to English dollars.
Temp = ConvertHundreds(Right(MyNumber, 3))
If Temp <> "" Then Dollars = Temp & Place(count) & Dollars
If Len(MyNumber) > 3 Then
' Remove last 3 converted digits from MyNumber.
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
count = count + 1
Loop

' Clean up dollars.
Select Case Dollars
Case ""
Dollars = "No Dollars"
Case "One"
Dollars = "One Dollar"
Case Else
Dollars = Dollars & " Dollars"
End Select

' Clean up cents.
Select Case Cents
Case ""
Cents = " And No Cents"
Case "One"
Cents = " And One Cent"
Case Else
Cents = " And " & Cents & " Cents"
End Select

ConvertCurrencyToEnglish = Dollars & Cents
End Function


Private Function ConvertDigit(ByVal MyDigit)
Select Case Val(MyDigit)
Case 1: ConvertDigit = "One"
Case 2: ConvertDigit = "Two"
Case 3: ConvertDigit = "Three"
Case 4: ConvertDigit = "Four"
Case 5: ConvertDigit = "Five"
Case 6: ConvertDigit = "Six"
Case 7: ConvertDigit = "Seven"
Case 8: ConvertDigit = "Eight"
Case 9: ConvertDigit = "Nine"
Case Else: ConvertDigit = ""
End Select

End Function

Private Function ConvertHundreds(ByVal MyNumber)
Dim result As String

' Exit if there is nothing to convert.
If Val(MyNumber) = 0 Then Exit Function

' Append leading zeros to number.
MyNumber = Right("000" & MyNumber, 3)

' Do we have a hundreds place digit to convert?
If Left(MyNumber, 1) <> "0" Then
result = ConvertDigit(Left(MyNumber, 1)) & " Hundred "
End If

' Do we have a tens place digit to convert?
If Mid(MyNumber, 2, 1) <> "0" Then
result = result & ConvertTens(Mid(MyNumber, 2))
Else
' If not, then convert the ones place digit.
result = result & ConvertDigit(Mid(MyNumber, 3))
End If

ConvertHundreds = Trim(result)
End Function


Private Function ConvertTens(ByVal MyTens)
Dim result As String

' Is value between 10 and 19?
If Val(Left(MyTens, 1)) = 1 Then
Select Case Val(MyTens)
Case 10: result = "Ten"
Case 11: result = "Eleven"
Case 12: result = "Twelve"
Case 13: result = "Thirteen"
Case 14: result = "Fourteen"
Case 15: result = "Fifteen"
Case 16: result = "Sixteen"
Case 17: result = "Seventeen"
Case 18: result = "Eighteen"
Case 19: result = "Nineteen"
Case Else
End Select
Else
' .. otherwise it's between 20 and 99.
Select Case Val(Left(MyTens, 1))
Case 2: result = "Twenty "
Case 3: result = "Thirty "
Case 4: result = "Forty "
Case 5: result = "Fifty "
Case 6: result = "Sixty "
Case 7: result = "Seventy "
Case 8: result = "Eighty "
Case 9: result = "Ninety "
Case Else
End Select

' Convert ones place digit.
result = result & ConvertDigit(Right(MyTens, 1))
End If

ConvertTens = result
End Function

View 9 Replies View Related

Calculating Finance Figures

Mar 1, 2007

Hi
I would be glad of a little help.
I am creating a c ontracts database and need to keep trak of individual contractors figures.

I set up a contractor and allow the system to only issue orders to a contractor if there monthly balance doe not exceed 1/3 of their total monthly turn over.

My problem is in keeping track of the relevant figures and how I go about this?

Thanks in advance

View 6 Replies View Related

'Sum' Ignoring Minus Figures

Jan 22, 2007

I've been using the following query:

SELECT
[qry_1].Month,
B_Division_Group.Grouping_Name,
Sum([qry_1].Month_Client_Count_from_B) AS Monthly_Count,
Sum([qry_1].Month_Assets_from_B) AS Monthly_Total,
Sum([qry_1].YTD_Client_Count_from_B) AS Yearly_Count,
Sum([qry_1].YTD_Assets_from_B) AS Yearly_Total
FROM
([qry_1] INNER JOIN tbl_branch
ON [qry_1].BranchCode = tbl_branch.BranchID)
INNER JOIN B_Division_Group
ON tbl_branch.BranchName = BDivision_Group.N_Br
GROUP BY
[qry_1].Month,
B_Division_Group.Grouping_Name;

While all monthly and yearly values were positive, the query produced exactly the results expected (i.e. one row of data for each Grouping Name/Month combination, containing the overall totals for each field).

Now, however, some Grouping Names have minus values and the query is showing an extra row (one for positive values, one for negative). It's as if having one or more minus values is being treated as a new Grouping Name/Month combination.

Is Sum() the correct method to use, when dealing with negative values, or should I be using some other function?

View 3 Replies View Related

Setting Up A Table For Sales Figures

May 6, 2005

Dear All,
My boss wants me to create a budget report as follows:

Rep Cust ActM$ BudgetM$ VarM$ ActMProfit BudgetMProfit VarMProfit

ActYTD$ BudgetYTD$ VarYTD$ ActYTDProfit BudgetYTDProfit VarYTDProfit


I have a table with the following headings:

Date State Product Prod Code Customer Cust Code Category Jan Feb Mar etc

State has the domain Vic, NSW, Qld
Category has the domain Sales GP

Question 1:

To the field Category, should I either

A: add to the domain actual sales and actual profit? I can past these into the table at the end of each month.

OR

B: set up a separate table for the actual sales and actual profit for the month?

I think A.

Question 2:

Instead of having a separate column for each month, should I either:

A: just have a heading Month and put the figures in that column

OR

B: Have the sales figures in separate columns for each month?

I think A

Question 3:

When I have set up my table correctly, and assuming the answers to my questions above are all "A", I am now unsure how to create a query which will give me the data for the report my boss wants.


Can someone please give me some help?

Thanks
Bon

View 4 Replies View Related

Lookup Multiple Figures Within A Column?

Feb 6, 2007

Hi

Is there a way you could look up multiple number in a query were the column will be a series of numbers/calculations?

E.g.

I would want to look for 13001,13002,13003, in a column where there would be calculation such

13001 * 246
13001 * 269
13002 849
etc
etc

Any help would be much appreciated?

Thanks

Andrew

View 1 Replies View Related

How Do I Create A Table That Contains Figures Calculated From Other Tables?

Feb 18, 2008

Hi,

I have two tables:

Table A provides total sales volume of the UK shoe market from 2000-2007.

Table B provides the sales volume of different shoe manufacturers from 2000-07.

I want a third table created, called Table C. This should look exactly like Table B but instead of sales volume it shows percentage sales that are calculated by using the figures in Table A and B (i.e. [sales volume from Table B/total sales volume from Table A] * 100).

Could someone point me in the right direction please (assuming that such a table can be created, based on a calculation of figures in other existing tables).

Thank you.

View 3 Replies View Related

The Need For Speed

Oct 18, 2005

Hi,

I have a growing Access database in a multi-user environment over a 10/100Mb network. The database is all in one file at the moment, on a shared directory of our XP-Pro 'Server', and the workstations have a mapped drive to it and are W98SE machines. All the machines are 1.2Ghz Fujitsu Siemens machines.

It is still under development, but is also in constant use, and I therefore have to develop on a copy, then get everyone out so I can copy in the changes. I would love it to be a client/server setup and split the db to Tables only backend on the server and progams on the client, but when I tried, the result was a dramatic slow-down in the system...it became unusable.

I do have a budget for this, and could get a proper 'server' or maybe an Ethernet Disk, but what is the best config for speed and admin purposes. Anyone doing something similar??

Thanks

View 14 Replies View Related

Speed Of Calculation

Apr 5, 2007

Hey,

I noticed something strange in access 2000: sometimes it takes a long time to calculate a report and other times it goes rapidly. I don't see any process taking a lot of CPU %.

When i do the same thing in Access2003, it goes rapidly every time.

Can anyone help me?

Rik

View 1 Replies View Related

Query Speed

Nov 2, 2005

I have a number of queries which build two or three Union queries which looks at 35,000 records, and when you open the Union queries or run reports it takes forever for them to open.

I have indexed all the tables which have the common fields to see if this speeds it up the queries, but there still slow. The table they look at are in two different tables which are linked into a front end where the queries are!

View 2 Replies View Related

Query Speed

Mar 24, 2006

I query against a table with 380K records and growing.

There are approx 14 fields in the table, but I only retrieve 7 in my query. Does having those extra fields in there slow the query down, or does the query ignore them?

Just trying to figure out ways to improve speed.

Thanks.

View 3 Replies View Related

Speed Question...

May 23, 2007

Which is faster, placing a calculation
ItemNumber: IIf([MANITEMNO]<>" ",[MANITEMNO],[ITEM])
in a query or placing
=IIf([MANITEMNO]<>" ",[MANITEMNO],[ITEM])as a Control Source in a text field on a form or report :confused:

View 12 Replies View Related

Dlookup Speed

Dec 19, 2007

I was brought up to believe in Santa Claus and that DLookups were slow. I browsed last night and found many threads mentioning speed issues with DLookups.

My latest project consists of upgrading a database written at a Client Site that is chock full of (you guessed it) DLookups. My normal inclination was to replace them with parameter queries. But before I did, I ran some benchmarks of DLookup vs Parameter Query speed. In all cases (table1 = 11 records, table2 = 1,143 records) the DLookup was faster.

My test was to lookup a field based on the recordset's primary key. In table2 I tested a record mid way down and the last record. DLookup is the winner hands down.

Should I also stop believing in Santa Claus. Too bad because I have a new notebook on my wish list.

Thanks for your wisdon.

View 1 Replies View Related

Database Speed

May 24, 2005

Can anyone offer suggestions as to why, when I split my db, place the backend on the server, and open Form2 my front end grows from 2.25MB to 3.95?

I was using macros to filter the data for each type of project and that does not affect the db size nearly as much as this does.

I am using the following code on the On_Click event of the "View Projects" button on Form2 to build the criteria for the records to appear on my "Projects" form.

Private Sub cmdOK_Click()
Dim varItem As Variant
Dim strSubtype As String
Dim strStatus As String
Dim strSubtypeCondition As String
Dim strSQL As String
Dim strSortOrder As String
Dim cat As New ADOX.Catalog
Dim cmd As ADODB.Command

For Each varItem In Me.lstSubtype.ItemsSelected
strSubtype = strSubtype & "," & Me.lstSubtype.ItemData(varItem)
Next varItem
If Len(strSubtype) = 0 Then
strSubtype = "Like '*'"
Else
strSubtype = Right(strSubtype, Len(strSubtype) - 1)
strSubtype = "IN(" & strSubtype & ")"
End If

For Each varItem In Me.lstStatus.ItemsSelected
strStatus = strStatus & ",'" & Me.lstStatus.ItemData(varItem) & "'"
Next varItem
If Len(strStatus) = 0 Then
strStatus = "Like '*'"
Else
strStatus = Right(strStatus, Len(strStatus) - 1)
strStatus = "IN(" & strStatus & ")"
End If

If Me.optAnd.Value = True Then
strSubtypeCondition = " AND "
Else
strSubtypeCondition = " OR "
End If

'Build the sort order

If Me.cboSortOrder1.Value <> "Not Sorted" Then
strSortOrder = " ORDER BY tblProjectDetails.[" & Me.cboSortOrder1.Value & "]"
Else
strSortOrder = ""
End If

'Build the SQL statement

strSQL = "SELECT tblProjectDetails.* FROM tblProjectDetails " & _
"WHERE tblProjectDetails.[subtypeid] " & strSubtype & _
strSubtypeCondition & "tblProjectDetails.[status] " & strStatus & _
strSortOrder & ";"

cat.ActiveConnection = CurrentProject.Connection
Set cmd = cat.Views("Query1").Command
cmd.CommandText = strSQL
Set cat.Views("Query1").Command = cmd
Set cat = Nothing

DoCmd.OpenForm "Projects", , "Query1"

I have cleaned up my code, compact and repaired, compiled, got rid of unneeded tables, queries, etc. and no change.

I have read up on all of the possible causes/solutions and can't seem to narrow it down.

Thanks for any help,

Toni

View 2 Replies View Related

Speed Issues

Dec 27, 2004

I am making a internet-game. It has for every register player quite some variables stored in a database.

On nearly all pages the database is accessed, modified and closed again. Let's say each player has 20-25 variables stored in the database. Would this cause speed problems? Any ideas to solve this?

View 2 Replies View Related

Speed Up Remote Access

Oct 4, 2006

I have a database on a server that is accessed by mobile clients using laptops (broadband)
when out of the office. They use'virtual private network service' to do this.
(I did not set this up, I just design and program the front and back ends)
However some report a slow response time when retieving data from the database file.

Would 'Active desktop' be any quicker?
Any suggestions on how they might speed things up, would be most welcome
'Replication' comes to mind but I think their data must remain up to date at all times.

View 3 Replies View Related

Speed Of Network Database

Jun 5, 2007

Our office runs on a pretty large Access database (v2003). We are on a large hospital network and have about 15 users for our database. It tends to run VERY, VERY slow. Are there other options?

View 4 Replies View Related

Split DB Speed Performance?

Sep 23, 2007

Hi All,

A DB is split (FE / BE) with several FE users and the BE sat on a network.
FE Access 2003. (runtime)
The Sub form has record set type set to Snapshot.

Which of the following scenarios will perform fastest?

Scenario 1,
The FE Queries a linked table and displays the results on a sub form (Datasheet Format).

Scenario 2,
The BE table is copied to the FE (new table) and the query is run against the new table and displays the results on a sub form (Datasheet Format)

The reason for this question is to attempt to reduce the network traffic and further improve the speed performance of a split database.

Garry

View 5 Replies View Related

Trying To Speed Up Access Database

Jun 24, 2005

I have a database that is split into a FE / BE with the BE running on a server and users are accessing thru a dial up connection. This is working very slow do to the fact that I have combo boxes that users select data from that are based on different tables and every time you click on a combo box it takes several minutes to open deponding on the number of records. At 1st I thought that maybe converting to SQL would help solve this but the more I read the less I think that will do the trick. Could someone please advise me on the best solution here.

Thank you

Jim

View 10 Replies View Related

How To Speed Up A Left Join?

Jan 20, 2006

Hi,
I am doing a Left Join to try to look up values in a large (about 100,000 records) table. If the value isn't found, I'm using the nz function to supply a value.

This query runs very slowly (takes about 2 minutes). I can understand why... I suppose that for every value it's trying to look up , it has to loop through all 100,000 records before it decides that it's not there.

So, I am just looking for ideas on how to make this run faster.

I do have indexes on all my join fields and criteria fields.
Thanks for any suggestions.

Here's the SQL:

SELECT VM1a.row, VM1a.Column, VM1a.Noun, VM1a.Rev, VM1a.RefDes, VM1a.repcode, VM1a.Cell, VM1a.InspPoint, VM1a.DefectType, CLng(nz([FirstOfTruncatedOpSeq],0)) AS ZOpSeq, Sum(VM1a.DefectQty) AS SumOfDefectQty
FROM VM1a LEFT JOIN BOMOutRefDesOnly ON (VM1a.RefDes = BOMOutRefDesOnly.RefDesOnly) AND (VM1a.BOM1 = BOMOutRefDesOnly.PCAItemNo)
GROUP BY VM1a.row, VM1a.Column, VM1a.Noun, VM1a.Rev, VM1a.RefDes, VM1a.repcode, VM1a.Cell, VM1a.InspPoint, VM1a.DefectType, CLng(nz([FirstOfTruncatedOpSeq],0));

View 1 Replies View Related

Query Speed Improvements

Apr 24, 2007

I have a lot of queries based on queries. These all work as desired, however they can be slower than I'd like.

Given that my company has no intention of changing to another piece of software I am, therefore, limited to whatever speed I can get out of Access.

Are there any general rules or guidelines that a more experienced person could recommend to ensure that all these queries run as quickly as possible?

View 11 Replies View Related

Recall - Speed Up Linked DB

Dec 14, 2004

I've created an Access DB on a Citrix server which is multi user so has been split and user linked tables. It runs quite slow however. At the moment I don't have time to convert it to unbound forms, so have read that one solution to speeding it up is to create a table in the back end tables to the main DB. Then use the open recordset event to keep the link between the two open.

I know how to link the two, but can someone explain the open recordset part please. What do have to do?

Cheers,
Recall.

View 6 Replies View Related

Query Speed - 7 Million Records!

Jul 27, 2005

I have a table with 7 million records. Using my continuous Form, I have been using right mouse click and entering in a parameter e.g. *my search term* to filter and this takes some time before the results are shown. This gives a reduced list of say 1,000 records. But then, when I click in the column and try to sort, it takes ages to sort the records.

So, my problem is two fold: firstly, it takes some time for the first filter to work; secondly, it takes time to sort.

Should I be doing this in a different way? Any other tips for filtering and sorting faster?

Thanks,

Dave

View 3 Replies View Related

ACCESS 2003 & SPEED Ferret

Jun 29, 2006

We have SPEED Ferret 4.1, but we've upgraded ACCESS 2003 which 4.1 does not support. Does anyone know if a new version's coming out? Does 2003 have its own enhanced find and replace functionality?

View 1 Replies View Related

Over Coming Slow Network Speed

Nov 6, 2006

Hello,
I have split a database useing the database spliter wizard. But I still have network speed problems. What I am wondering is if anyone knows if useing an ODBC connection between the front and back ends is more efficient than file sharing across the network?
Thanks for any information on this
Tim

View 4 Replies View Related

Speed Up A VERY Slow Append Query

Jul 27, 2006

All,

I'm not sure how well I've managed to search on this as I'm not too sure where to start!

I have an append query as follows:

INSERT INTO tbl_Employee ( Company_No )
SELECT tbl_Co_Data.Company_No
FROM tbl_Co_Data
WHERE (((tbl_Co_Data.Company_No) Not In (select Company_No from tbl_Employee)))
ORDER BY tbl_Co_Data.Company_No;

Basically this query is run a number of times a day and appends new company numbers in to a table - 'tbl_Employee'. It's badly named - it's not got much to do with employees. Any way it takes a good 3 minutes to run with about 20k records in tbl_Co_Data and probably 18k records in tbl_Employee.

It looks to me like it's looping through each record in one table for each record in the other - which is plain daft.

I'm currently experimenting with a DTS package that puts tbl_Co_Data in to SQL server first before the query would run (tbl_Employee is already there) with a view to running a SP and ditching the query.

Does anybody have any other ideas as I'm having problems with the DTS in that it appears to be pretty slow in itself!

Many thanks in advance for any response.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved