Selecting Records From Query Where Sum Of Values Is A Certain Amount
I am trying to manipulate a query whereby if I sort the query in descending date it will select the most recent orders which will add up to a particular value (and include the first record which will take the total over that value)
i.e. if my chosen value is 100, there are orders in date order of 40, 30, 10, 10, 15, 40, 35, 50...
it will select the first 5 records (40+30+10+10+15=105), but no others. Even if it could select the first 4 (sum is less than 100) this would be a help.
I'm figuring out how to do it in VBA/SQL by going through records one by one and adding up the values, then selecting the appropriate records and moving them into a table. However, I was just wondering if there is a trick something along the lines of 'top10' which would save time and reduce potential bugginess, or even a one or two line command which may do it.
Advanced thanks to any star who can help.
Gray
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Selecting A Set Amount Of Rows?
I am using SQL Server 7 and I wish to return 1 row from a query. I know there is a rowcount reserved word but I can't get it to work. Here is my query:
Select * from tbl
Where rowcount = 1
I keep getting an error on this statement!
Thanks,
Blake
How Can I Know The Total Amount Of Records? (Using GET/PUT)
Hi Guys!
I'm making an app using get/put and a Type that handles details on people, names, age, etc...
Now, my question is, how can i have my app tell me how many entries or people are saved on the file, or the number of records?
Heres a small example of how the info is saved:
GENT.Name = Text1.Text
GENT.Age = Text2.Text
Put #1, REC, GENT
The REC variable tells the app which record to save to.
GENT is the type i made.
How can I know the total amount of records?
Thanks a lot!!!
Wrong Amount Of Records
Hi.
My problem is that I execute a query and the results are stored in a recordset.
But sometimes the recordcount of the recordset object says there are, for example, 4 records when there actually really are 3 records.
Why does this happen, and how can I prevent this from happening?
Thanks,
Michael Nattfalk
Limiting The Amount Of Returned Records?
I have an access database that gets records from a SQL server. It gets server load records like cpu and memory usage and then draws charts from them. It works fine but the problem is that when i query records for a few servers with a couple parameters and for a three week period the amount of returned records is easily 50K. The thing is that i don't need that many. I don't need hundreds of records per parameter per day to make the chart usable. So how to limit the record amount without cutting it from one end. I would like to drop records randomly. I think i could make a table and make a loop that saves only every nth record and deletes the rest. And i also thought that if i could somehow make a query that uses the timestamp in the records to get only one record per hour. Here is a couple of samples from the returned data:
parameter_name instance_name app_name node_name time_stamp value
MEMmemAvailableBytes NT_MEMORY NT_MEMORY esps0032 7.5.2004 23:49:26 557,504
MEMmemAvailableBytes NT_MEMORY NT_MEMORY esps0032 7.5.2004 23:52:26 557,789
MEMmemAvailableBytes NT_MEMORY NT_MEMORY esps0032 7.5.2004 23:55:26 557,992
MEMmemAvailableBytes NT_MEMORY NT_MEMORY esps0032 7.5.2004 23:58:26 558,434
parameter_nameinstance_nameapp_namenode_nametime_stampvalue
CPUprcrProcessorTimePercentCPU_1NT_CPUesps00323.5.2004 9:46:023,35938
CPUprcrProcessorTimePercentCPU_1NT_CPUesps00323.5.2004 9:52:023,79774
CPUprcrProcessorTimePercentCPU_1NT_CPUesps00323.5.2004 9:58:0218,3724
Has somebody found a good solution for similar problems? Any help would be appreciated!
Finding The Amount Of Records In A Database
In my small application I need to display at the bottom, the current number of records in the database. How can I do this? I've tried using index but it throws an error since it isn't an array.
Code:
Private Sub Form_Load()
Dim total As Integer
total = adoAuto.Index
lblCountTotal = total
End Sub
Code To Find The Amount Of Records Already In A File?
Is there a code to find out how many records thier are in a file?
Edit: just thought of this right here right now, would this work?
VB Code:
Dim recordnumber as IntegerDo while not EOF(2) recordnumber = recordnumber + 1 Seek#2, recordnumberLoop
Reading .dat Records && Creating Correct Amount Of Labels
Hi, I have a form that writes records to a .dat file. I want to make another form which displays all of the records in labels, so, my question is how do I get it to show all the records in labels and create the right amount of labels automaticly?
Thanks
How To Make A Form Default All Field Values To The Previous Records Values ?
Using Access2000 on 2k.
Have a database form in single form view (has a sub form in it).
Got a request to put in a button that will do the same as new record but default the new record to all the same values as the current forms record shows. I think there are several ways to do this, I'm afraid I'll pick the most difficult one if left to my own devices. (i.e. DAO recordset looping etc.)
The first thing I tried was using a wizard to add a button and chose the duplicate record offer from the wizard. It almost works but it presents a record without the arrow or the pencil in it, gives it a record number that makes me think it has appended it. but when I move away from the record and back to it again, it's empty.
If I right click and copy and then paste it does what I expect it to. That is put the copied information in the end record.
But the user doesn't want to copy and paste, they just want to push the button and then modify the needed fields.
I wizard gave me code that looks like this:
Private Sub cmdDupRec_Click()
On Error GoTo Err_cmdDuplicate_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
Exit_cmdDuplicate_Click:
Exit Sub
Err_cmdDuplicate_Click:
MsgBox Err.Description
Resume Exit_cmdDuplicate_Click
End Sub
Selecting Nth Records
HI
Is it possible to select (or make a table of) every Nth record in a Access table?
thanks in advance
Selecting Records
please help.
i need to select records within two specific dates (example:Starting date: 01/08/2000 and ending date 30/08/2000)Now the query should choose all the dates within August 2000. The query that i am using is working great in access, but not when i am trying to use it in my program... it tells me that there is no such record(-01).
Can anyone tell me what is wrong with this coding... if there is something wrong.
code example:
Dim sql As String
Dim df As String
Dim dt As String
df = InputBox("Select starting date:")
dt = InputBox("Select ending date:")
sql = "SELECT simtable2.ActivationDate From simtable2 WHERE (((simtable2.[ActivationDate]) >=" & df & " and (simtable2.[ActivationDate]) <=" & dt & "));"
datPrimaryRS.RecordSource = sql
datPrimaryRS.Refresh
ps. there are other dates in between the month of august wich means that it is not sorted according to dates.
edward
Selecting Only Last 10 Records
Hi All
I am using msflexgrid to display the records.I want to display only last 10 records from a table, in the grid.How to select Only last ten records from the table.
Thanks in advance
Regards
Selecting Records
Hey,
I have a Schedule table where contacts have appointments.
Sometimes a contact can have more than 1 appointment in 1 day. I want to be able to select all appointments for 1 day but only show the earliest one if a contact has more than 1.
Thanks,
Selecting Records To A Datagrid
I have a datagrid bound to a dataenviroment that is connected to an access database. I need to select some records to show in the datagrid, the base to select them is a number in a textbox that is saved in a Global Variable.
I also have another prob. with the same datagrid with the same properties and need to insert from the same textbox a value on first column,of every line of the datagrid!
If anyone can hep me!
Selecting Records Alphabetically
I have a simple contacts database in access and would like to know how I can select each group by clicking a button such as
'A' 'B' 'C' and so on...
" the user clicks the 'a' and this will show all records listed by last name beginning with 'a' and so on with the rest of the alphabet "
Thanking you in advance
RJKealey
Selecting TDBGrid Records
Hi Guys,
I have a True DBGrid that when selected will show a record.
The problem im having is I select the row in the grid and it highlights correctly but the record doesnt change untill i re-select the record a second time??
Here is what my code is,
Private Sub TDBGrid1_Click()
varname1 = ""
varname1 = Replace(Data1.Recordset(1).Value, "'", "''")
Command7_Click
End Sub
Thanks again Guys
C
Selecting Records For A Report
I have a form and within it a subform which displays data for each record
in a table. What I need to do is to allow the user to select which of the records will go on a report. How can I accomplish this?
Selecting Multiple Records
Hello,
I'm using access db and using sql statements to query the db.. i have a problem where i'm using a select statement with a phone number to call up the record of that specific person with the phone number... but say if i have two records in the database with the same phone number, how can i pull both of those out? because it is only selecting the first one it see's in the database.. i was going to have to program get all of the records that match the phone number and then pop up another form that has them select the one they need and then go from there..
does that make any sense? just trying to figure out how to pull out more than one record at a time if possible..
thanks for any help
--Val
Selecting Range Of Records
I'm trying to select the first 5 records in my Access DB and from that selection find the Max and Min of the field 'Score Total'. My problem is I need to sort the table by the 'Date Played' field first but I get the following below error when I use the code below.
Can anyone help me out??
"You tried to execute a query that does not include the specified expression 'Date Played' as part of an aggregate function"
Code:
sSQL = "Select Top 5 Max([Score Total]) AS MaxScore, Min([Score Total]) AS MinScore FROM tblScores WHERE CourseName = '" & CourseName & "' ORDER BY [Date Played] DESC"
EDIT - *SOLVED*
This is how I solved it
Code:
sSQL = "Select Top 5 Max([Score Total]) AS MaxScore, Min([Score Total]) AS MinScore FROM
(Select Top 5 * From tblScores WHERE Name = '" & CourseName & "' ORDER BY [Date Played] DESC)"
Selecting Difference Between Records
Hello,
Just wondering how to select the records between 2 tables in mssql which are different. Like I want to select records in table1 which doesn't exsist int table2.
Selecting Records In A ADO Recordset
I am having trouble in trying to query a recordset.
Code:
'SQL statement to load into recordset the database records
strJourneyQuery = "SELECT TrainJourney.TimetableNumber, TrainJourney.JourneyNumber, Station.StationName, Trainstop.ArriveDepartTime," & _
"TrainJourney.EngineID, Engine.EngineName, Engine.EngineNumber, TrainJourney.DriverID, Driver.DriverName FROM Station, " & _
"TrainJourney, TrainStop, Driver, Engine WHERE Station.StationID = TrainStop.StationID " & _
"AND TrainStop.JourneyNumber = TrainJourney.JourneyNumber AND TrainJourney.DriverID = Driver.DriverID " & _
"AND TrainJourney.EngineID = Engine.EngineID"
'open the recordset
adoJourneyQuery.Open strJourneyQuery, db, adOpenKeyset, adLockOptimistic
I create the recordset and then would like to select some records from it based on what the user enters. I cant use .Open strJourneyQuery & " AND [" & strField & "] LIKE '%" & strInput & "%'" however as there are fields of the same names in some of the tables and it doesnt know which field to query against.
could someone tell me the best way to solve this if possible please
thx in advance
Peter
Selecting Records From A List Box
Hello all,
I wrote a program for guys at my work to automate some tasks for them. The program reads in a list of IP addresses from a text file and run maintenace commands on them. They have asked for a change to be made and I am unsure of how to do it.
Right now i read all of the IP Addresses into a collection. From there i grab the IP and yadda yadda yadda commands have been run. They would like the program to allow the user to select multiple IPs from the list rather than having to modify the .txt file. I was wondering is there a way to read in selected records from the list box and then form the collection from the selected IPs.
Thanks
Selecting Records Between Two Dates
I want to select records between two dates from a table.
StartDate and EndDate are two Dates but the code below does not seem to work. I get an operator/operand type mismatch.
rstChkdisb.Open "select * from mytable where ck_date >= " & StartDate & " And ck_date <= " & EndDate & " ORDER BY ck_no", Cnn2, adOpenStatic, adLockReadOnly
Selecting Duplicate Records
I'm using Access as my database, i'm trying to select duplicate records from the database. I've thought of using the 'Distinct' keyword, but i want to select or view the records which are not filtered by the distinct keyword. Let say I have 10 records in my database and 4 of them are identical, if i used the distinct keyword it'll show me a total of 7 records, correct? But i want to view the other 3 records which has not been included, how am going to that? Please help
Selecting A Records From Dataset
Hi,
I wanted to select a particular records from dataset? anybody for helo???
is there anything like we give where clause in SQL
How Can I Make A Group Amount/ Total Amount Recordset ?
Hello,
If I have a table have (id, amount) and id can be duplicate. How can I make a recordset having id,amount, amount percentage where amount percentage is group amount/ total amount. How can I make a recordset like this ?
Selecting Records In An Access Database Thru VB6
Ok I am trying to return some records from an Access database. For some odd reason this will not work. When I try to just return the BillToID it works, but not when I try to add the date of the invoice to print. Here is the SUB I am using, and the database layout.
Code:
Invoices
BillToID = Long Integer
DateOfInvoice = Date/Time
Code:
Sub PrintDaysInvoice(BillToID, BillDate)
'MsgBox "This feature is not yet working", vbInformation, "Invoices"
'Exit Sub
On Error GoTo ErrorPrintTodaysInvoice
MsgBox "BillToID-" & BillToID & vbCrLf & "BillDate" & BillDate
'Exit Sub
'Dim strFormLoadNumber
Dim A
Dim acNormal
If strDBOpen = 0 Then
OpenDatabase
End If
strSql = "SELECT LoadNumber"
strSql = strSql & " FROM Invoices"
strSql = strSql & " WHERE BillToID=" & BillToID
strSql = strSql & " AND DateOfInvoice=#" & BillDate & "#"
Set rs = my_Conn.Execute(strSql)
If rs.EOF Or rs.BOF Then
MsgBox "Can't find this invoice to print.", vbCritical, "Invoices"
Else
Do Until rs.EOF Or rs.BOF
strMessage = strMessage & vbCrLf & "LoadNumber-" & rs("LoadNumber")
'PrintInvoice rs("LoadNumber")
rs.MoveNext
Loop
MsgBox strMessage
End If
rs.Close
Set rs = Nothing
CloseDatabase
Exit Sub
ErrorPrintTodaysInvoice:
MsgBox Err.Description, vbCritical, "Invoices"
End Sub
Selecting Records With Crystal Reports
I have a VB project that creates records in an Access 97 database. I am using Crystal Reports to do the reporting. The database holds information about clients. One table holds name and address, others (with a one-to-many relationship) hold supporting information such as family contacts.
I have created a report and placed the .rpt file in the same directory as the database. I am having trouble creating the select command. What am I doing wrong? The report prints for the entire database with just the PrintReport command. Nothing prints when I try to limit the report to one client. Here is my code:
DOLReport1.ReportFileName = "C:DiscOfLifeDevelopment estDOL.rpt"
DOLReport1.SelectionFormula = "{ClientTable.CTKey}= " & sCurrentDOLClientKey
DOLReport1.Destination = crptToWindow
DOLReport1.PrintReport
Any suggestions are appreciated,
Thanks,
Selecting Certain Records For A Crystal Report
Can someone please tell me why, in the following code, when I use a variable in VB6 to get data to display in Crystal reports, that the select statement does not work and I get all the data in the table viewed.
the variable is:
public SelectedSiteNames as string
the variable is selected by a selection window I have created.
the select code in the crviewer form window is:
strsql = "SELECT SiteCalls.* FROM Report_Data as SiteCalls WHERE SiteCalls.Site = '" & cstr(SelectedSitesNames) & "'"
When I run this statement in Quary Anaylser for MS SQL, I get the correct information.
If is change the statement in VB and place the variable with actual site name, the statement works.
Please help
Trevor
Selecting Records Using 3 Combo Boxes
I have a form created in Access. I want to be able to select specific records using 3 combo boxes, so for example, the first combo would select the date, the second a location and the third an individual (all from the same table) - this will then display the details of that particular record.
I have tried to use the combo box/ list box wizards, and selected the third option; Find record on my form based on the value I select. When I try to select the record using the combo (or listbox) nothing happens in the main form. What else should I be doing to make this work? I am a beginner with Access.
Thanks in advance
Selecting Multiple Records Using Recordselectionformula
Can someone tell me what's wrong with this formula:
crpReport.RecordSelectionFormula = "{SignageTable_CRP.sku} in '" & frm_ReportPrint5.Text1 & "', '" & frm_ReportPrint5.Text2 & "', '" & frm_ReportPrint5.Text3 & "', '" & frm_ReportPrint5.Text4 & "', '" & frm_ReportPrint5.Text5 & "', '" & frm_ReportPrint5.Text6 & "', '" & frm_ReportPrint5.Text7 & "', '" & frm_ReportPrint5.Text8 & "', '" & frm_ReportPrint5.Text9 & "', '" & frm_ReportPrint5.Text10 & "'"
SELECTing Records From An Auto Int Field...
I have a field in my file that is type: int & identity field (not for replication).
When I try to run an SQL statement against the file to retreive a record that I know exists it hits EOF and does not return my record. I am converting a string "txtVendID.text" from a text field to do the search into an int by using the cint() function. However it still does not find a match. If I change the key field back to nVarChar everything works but I can't have an auto-incrementing key.
Here's how my SQL statement looks: (searching in an SQL 2000 database)
rs.Open "SELECT * FROM Vendors WHERE Vendor='" & CInt(txtVendID.Text) & "'", con, adOpenForwardOnly, adLockOptimistic
Can anyone see what I am doing wrong ???
Selecting Records From Sql Based On The Date
hai guys
i have some problem. when i want to get records from a database in sql6.5 server thru VB in network i receive a message wrong comparison between int and date. the problem is the date format in the database in the server is in long date format (ex.dec 31 2002 12:00am). but vb is recognizing date in the small date format in the system which vb is running. so is there any solution for this those who know pls help me.
Selecting Records From Foxpro Table
I am trying to extract some records from a table (exam.dbf) and copy the recordset to another dbf file.
I use the following connection string:
CNSTR = "Provider=MSDASQL.1;" & _
"Persist Security Info=False;" & _
"Driver={Microsoft Visual FoxPro Driver};" & _
"SourceDB= " & SRC_DBF_FILE & ";" & _
"SourceType=DBF;Exclusive=No;" & _
"BackgroundFetch=Yes;Collate=General;Deleted=Yes"
cn1.Open CNSTR
And i have the following statements:
STR1 = "select * from exam where date>={^" &
Format(FROMDT, "yyyy/mm/dd") & "} and date<={^" &
Format(TODT, "yyyy/mm/dd") & "} INTO TABLE " &
TDEST_FOLDER & "EXAMNEW.dbf"
cn1.Execute STR1
When i run the statements i dont get the new DBF file EXAMNEW.DBF in the Tdest_folder.
I am not sure where i get the error. If i run the same query in visual foxpro i get the new table. I am not geting the new table while running the query in VB.
Please help. Its urgent.
Thanks
Duraiappan
Display Records With Selecting In Treeview
Hi there,
I did the tutorial / FAQ about filling the treeview with a access database. It all works fine. (Big thanx for that)
Now i wan't to use the treeview to control a form next to the treeview.
For example: When the user selects a customer-name in the treeview, i wan't to display all the customerdetails in the form next to the treeview.
Is this possible ? and are there tutorials on this subject ? i've searched the whole forum, but couldn't find any solution.
I hope somebody can help me.
Big Thanx in Advance
Greetz ActionStart
Selecting Records From Access To Display In VB
After 234095234520 million attempts at this..someone suggested coming on here so here i am
ok so the problem:
I've got a database and im trying to get it to show its records though visual basic. i can do that but i want to beable to just select one at a time.
so i created a query in access that brings up a box and u type in the number 4 lets say and it display's that customers details. try do that in visual basic and it just breaks can anyone suggest what i should do or point out where im going wrong?
Thanks
from Helen
Selecting Random Records From A Record Set
I have an ado record set defined and opened in my project. The record set contains roughly 100 or so records.
What I want to do is to select 20 or so records at random and only allow the program to access these records.
I thought I could generate 20 random numbers and then go to these records but i have no idea as to how to do it.
Any help/comments are greatly appreciated
Thanks
Matt
Selecting Records In Msacces Between 2 Dates
hello,
i need to select records between 2 dates from a table called tblVaccinatie with columns :
- VaccinatieId
- VacDatum
- VacProdukt
- PatId
i am using this code now, but it isn't working
strVaccinatie = "Select * from tblVaccinatie where VacDatum between #" & _
dteVan & "#" & " and " & "#" & dteTot & "#"
dteVan and dteTot are the values of two datepicker controls
if u need more info to solve my problem, please tell me what is lacking
thnx, Koen
Selecting Default Values
Hi there, I am running an automated macro that runs at noon and midnight to record several data points in several different files. I have everything working, but am concerned that when someone on my network has one of the files open, and noone is around to watch the macro, that it will pause untill the "read-only" option has been selected to open the file. I need to ensure that the file opens, reguardless of it is open on another PC. I have the code to save it if it is open, but I can not babysit the macro. everything must be automated. is there any way to just select the default value when the pop-up box comes up to alert me that the file is open by another user??? any help is greatly appreciated
Selecting Changed Values
Hello!
I'm new at VB and I have a problem, so please HELP!
I have in diferent sheets values which i have to use and I want to use in my next step value that was the last changed!
Can you give me some advice, please?!
Thanx
Selecting Values That Are Not On The Listview
This is my sample code
Code:
...
rsSubjects.Open "Select * From LoadSectionSubjects Where Courses.Title=
'" & txtCourse.Text & "' And Sections.Title='" & txtSection.Text & "'
And " & "Semester='" & txtSemester.Text & "' Order by SubjectCode ASC", dbConnection, 1, 1
Dim i As Long
While Not rsSubjects.EOF
For i = 1 To lvwCourses.ListItems.Count
'The subject column is on the subitems 2 of the listview
If rsSubjects!SubjectCode<>lvwCourses.ListItems.Item(i).SubItems(2)
cboSubjectCode.AddItem rsSubjects!SubjectCode
End If
rsSubjects.MoveNext
Next i
Wend
...
Please guide me
Selecting A Range Of Values
i am currently making a calculator with a combobox which has about 100 set values. I am wanting to know how do i select a particular ranges of these values using an IF.. THEN.. statemet.
Private Sub Command1_Click()
If Combo1.ItemData(Combo1.ListIndex) = 2411 Then
Label13.BackColor = vbGreen
Label14.BackColor = vbYellow
Label15.BackColor = vbRed
Label16.BackColor = vbRed
End If
If Combo1.ItemData(Combo1.ListIndex) >= 2746 < 13363 Then
Label13.BackColor = vbGreen
Label14.BackColor = vbGreen
Label15.BackColor = vbRed
Label16.BackColor = vbRed
End If
end sub
When i select the value for lets say 2100 then the label13 and 14 are both green, and i assume this is because of the part < 13363 in the later IF THEN, how can i set it so only the specified range is the condition?
Selecting Combobox Values
Hi all,
Simple question but quite annoying me
I have a combobox on a form which is populated by:
Code:
With noCat
.AddItem (3)
.AddItem (4)
.AddItem (5)
.AddItem (6)
.ListIndex = 2
End With
When a item is selected i need certain objects on my form to become visible/invisible etc..
Im havin trouble in locating where to put the code for the change. I tried putting an if statement in the Change function:
Code:
Private Sub noCat_Change()
If noCat.Text = "0" Then
...........
But this doesnt seem to work.
Thanks for help with this,
Dan
Selecting Only The Filtered Values
Dear Friends,
I want to know the second row address and last row address in a filtered(Data->Filter) excel. For example, I have file containing a range from cell "A1" to "J21". I use filter command on a certain criteria, which shows the range "A1" to "J17". Now my requirement is to have srow="3" lrow="17". Ofcourse, I know the following command will do the needful:
range("a3:j17").select
But, how shall i determine "3" and "17" through a macro.
I am herewith attaching you my requirement for your reference and kindly request you to help me out in this regard.
Regards,
S. Sivakumar
Selecting Records Inside Data Grid
Hi all,
Some time ago I made an database 'front end' which has the ability to initiate queries etc, the results are populated inside a DataGrid (grdDataGrid).
Just wondering if its possible to some how capture a specific field from the data grid upon clicking a specific row.
For example, the list might contain:
Code:
TransactionID Surname
12345 Tester
54321 MySurname
How would I get the TransactionID for 'Tester' when the row (0) is clicked/selected?
Many thanks!
Selecting Specific Number Of Records Returned?
I'm trying to retrieve a specific number of records from a database query. Currently I am getting all of the records and then just putting the last 5 into my datagrid. What I would like to do is rewrite the query so that it only returns the number of records that I am looking for.
For example, if ID number 5 has 100 jobs entered into the database, I don't want to select all 100 jobs. I just want to return the last 5 jobs (based on a DESC custID field) in the jobs table.
Here is the code I am currently using to select all of the records. How would I go about rewriting this??
Code:
Set rsGetLastJobs = New ADODB.Recordset
rsGetLastJobs.Open "Select * From tblJob Where custID = " & intCustID, conCustomer, adOpenDynamic, adLockOptimistic
Does anyone have any idea's on how I would re-write this?
Thanks in advance.
DTFan
Selecting 15 Random Records From A Database Table?!
Hi everyone, if you can please help me out in here...
the problem is this:
I am building a quiz system in Visual basic, as part of my college project, and i need to select 15 random records from a Access database table named tblQuestions, and display them 1 by 1, in a VB form called frmQuestion. The player/user will navigate themself through the 15 randomly selected questions, using two command buttons cmdPrev for previous questions, and cmdNext for next questions.
The problem is that i dont really have much experience, and have been strugeling on how to do it. also, i am using ADO control (adodc) to conect the database with the VB form.
How would i go about doing this, would i introduce an arrey, where all the questions and answers will be stored, or how?, please help me its kind of urgent....thank you..please help
Selecting Null Records From An Access Database
I have tables for clients, payments and property. I want to know who hasn't paid in 2008. I can't use =null because if he hasn't paid there isn't a record created. How can I determine who hasn't paid?
HELP!
Crystal Reports And Selecting Top 10 Records To Display?
Hi, I am stuck and starting to up holes in the walls of my office using my head only!!!!
I have started using Crystal report 9 and I am trying to create a report to show the top X number of accounts.
Why? Because I have a points report which I want to create a top X build up of points.
I say X because I want to pass that X number into the report. So it will give me back the top X number of records.
What I have done is select my data which gives me everything back. But how do you only get the top X (say 10for example) records from the data.
Am I making sense?
HELP PLEAse....
|