multiple updates in parallel in access

gavsath

New Member
Joined
Apr 3, 2004
Messages
3
hi,

I have a database which lists a number of car rental records, each with the associated length of car rental - e.g. record 1 has rental length of 2.3 days, record 2 has a rental length of 5.2 days etc. etc.

What I would like to do is add a field which characterises each record by the following category
rental length <2 days
rental length 2 - 3 days
rental length 3 - 4 days etc

I can definitely do this by running update queries in sequence. is there a smart way in which I can get the table to update the table all at once? any suggestions gratefully received!

many thanks

gavin
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Is that all the categories?

I would suggest creating a user defined function, something like this:
Code:
Function RentalCategory(RentalLength) As String

    Select Case RentalLength
    
        Case Is < 2
            RentalCategory = "Less than 2"
        Case 2 To 3
            RentalCategory = "Between 2 and 3"
        Case 3 To 4
            RentalCategory = "Between 3 and 4"
' add other categories as required
        Case Else
            RentalCategory = "Other"
    End Select
    
End Function

You could then use this in your query.
 
Upvote 0
i love you guys. don't know what i would do without this site. thankyou

ps how do you learn all this stuff? are there any books you could recommend to learn the code? i have the access for dummies stuff but feel like i could get deeper into this
 
Upvote 0
How do we learn this stuff?

Why do you think we're answering questions anyways?



Note: Each question above is the answer to the other.

Mike
 
Upvote 0

Forum statistics

Threads
1,223,684
Messages
6,173,821
Members
452,535
Latest member
berdex

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top