So I have an access application to keep track of the status of small programmable PCBs that we use..
every time one of these pcbs is relocated or reprogrammed, an entry is made into a table in my db (tblLocation) with a unique ID for that action, the ID of the PCB (SD), the location it is going to, the new owner, the firmware version it's been programmed with and the date. Hence, multiple (dated) entries for each board are possible.
what I need to try and do is retrieve the most recent set of data from this table for every board we own... so far I have come up with a method that uses 2 queries, but I would like to combine this into one SQL statement that I can pass to the access db from an excel front end using ADO...
here's my 2 queries:
#1 (qryLastEntry) finds the date of the the most recent entry for each board:
SELECT DISTINCT tblLocation.SD, Max(tblLocation.Date) AS LatestDate
FROM tblLocation
GROUP BY tblLocation.SD;
#2 uses the result set from the above to retrieve only the most recent set of data for each board:
SELECT tblLocation.SD, tblLocation.Date, tblLocation.Owner, tblLocation.Location, tblLocation.Firmware
FROM qryLastEntry INNER JOIN tblLocation ON (qryLastEntry.LatestDate = tblLocation.Date) AND (qryLastEntry.SD = tblLocation.SD)
ORDER BY tblLocation.SD;
If there is a way to combine the 2 into one statement, that would be very useful, as although this method works just fine with access and using the built-in 'get external data' feature within excel, I'd like to be able to manipulate the SQL pragramatically (and also, I may want to migrate to mysql so a cross-platform solution would definitely be preferable in the long run).
I've had a look at using subqueries to achieve this but with no luck so far..
This query works, but is really slow. Is there a better way to write it? I have 2 tables, Card and Shipped. For all cards, I am trying to insert a record into the Shipped table if it they are not already there:
INSERT INTO SHIPPED (CardID, ShippedFrom, ShipDate, QtyShipped) SELECT Card.CardID,'Wpg',#1/1/2007#,0 FROM Card WHERE Card.CardID NOT IN ( SELECT Shipped.CardID FROM Card LEFT JOIN Shipped ON Card.CardID=Shipped.CardID WHERE SystemID= 10 AND ShippedFrom='Wpg' AND ShipDate=#1/1/2007# ) AND SystemID=10
i have created a query that solves for the difference of the debit and credit of the accounts receivables of a certain member or person..
SELECT DISTINCT ( (SELECT SUM(Amount) FROM (SELECT tblJournal.Amount, tblJournal.AccountAction FROM tblJournal WHERE JournalEntryNumber IN ( SELECT JournalEntryNumber FROM tblAccountsReceivableFromMembers WHERE MemberID = '2008-0001') AND AccountNumber = 120 ) WHERE AccountAction='Debit') - (SELECT SUM(Amount) FROM (SELECT tblJournal.Amount, tblJournal.AccountAction FROM tblJournal WHERE JournalEntryNumber IN ( SELECT JournalEntryNumber FROM tblAccountsReceivableFromMembers WHERE MemberID = '2008-0001') AND AccountNumber = 120 ) WHERE AccountAction='Credit') ) AS ['TotalAccountsReceivables'] FROM (SELECT tblJournal.Amount, tblJournal.AccountAction FROM tblJournal WHERE JournalEntryNumber IN ( SELECT JournalEntryNumber FROM tblAccountsReceivableFromMembers WHERE MemberID = '2008-0001') AND AccountNumber = 120 );
i need help on this so that there would only be one (WHERE MemberID = ?) to use. thanks so much! i hope to read your replies as soon as you can!
I have an Analysis_Database which reads tables and performs calculations in a Project_Database. There are multiple Project_Databases which reside together in a folder. To run my queries and analysis I link my Analysis_Database to each of the other databases and run my reports.
Is there a way to set up these links in a table or something to eliminate the Tools/Utilities/Linked Table Manager...etc
Any siuggestions to make this process more streamlined would be appreciated. (I can not make any changes to the Project_Database).
Since I am using Domain lookup function in this field, it takes considerable time for this field to get populated on the form when I move from one record to another.
Can anyone tell me the syntax for me to move this expression inside the Form's Query so this can execute faster?
Please note that I need this query to be updateable as I have some other form fields that needs to be edited.
Record_No <--- This is an autonumber field Est_COE --Date Field Type DATE_DOCR DATE_Followup Progress
I then have used multiple querries that just count records based off of Status:
Example of one of the querry's: SELECT Count(borrower.Record_Number) AS Close_Of_Escrow FROM borrower WHERE (((borrower.Est_COE) Between Date() And (Date()+7)) AND ((borrower.Progress)="active"));
Another Example of one other querry: SELECT Count(Borrower_Journal_Notes.ID) AS Followups_Not_Done FROM Borrower_Journal_Notes WHERE (((Borrower_Journal_Notes.Follow_Up_date)>Date()) AND ((Borrower_Journal_Notes.Followed_Up_Complete) Not Like -1));
Then I put both these querry's into a another querry so i can get the data put into a single form using one record source. (The master querry)
***this has already been posted on the report formus...i posted it here also due to its relation to forms***
**********************DO NOT GET MAD**************************
GOOD MORNING...
I currently have a form to launch a set of pre-desinged reports. The main function of the form is that it allows the user to sort or filter the data that appears in the report based on their selection (from combo boxes). I currenty have it set up so that the user can choose a specific client, facility, or region. The problem is the following:
THE FORM IS WAY TOOOO BUSY AND NEEDS TO BE SIMPLIFIED. EX:
CLIENT (combo box) Microsoft nortel dell ibm . . . btnLaunchRPT1 btnLaunchRPT2 btnLaunchRPT3
REGION (Combo box) North South East west north-west . . . btnLaunchRPT1 btnLaunchRPT2 btnLaunchRPT3
etc.
each btnLaunchRPT'n' has the following code DoCmd.OpenReport "rptECM Numbers", acViewPreview, , "[Region] = " & "'" & Me.Combo299 & "'"
but I change the [region] to whatever it is I am sorting by. Can I reduce this down to only having one set of btnLaunchRPT buttons that will detect what the user has selected and applies the proper sorts
Hi, hope someone has an idea of where to start on this.
Our company offers projects to multiple contractors and we have to enter when we spoke to them and their response. I put a textbox with default of Now(), thinking these would be recorded in real time and it would be no effort at all. But the offers are frequently entered days later, and keying in dozens of specific dates/times in the long format is very irritating for users.
Does anyone know of something similar to the DatePicker or calendar popups that will let you use arrows or comboboxes or something to quickly enter a time? We record date, hour & minute (no seconds) because it updates the contractor's order on the rotation list (i.e., next call is made to the contractor who has been waiting the longest for an offer). No ActiveX please, we're in secured network environment.