Jump to content

This topic is 7896 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

G'day All,

I'm new to the idea of multikeys and have read all the threads here but still need some help.

I have a database for booking rooms which uses a multikey based on these fields:

Date & room_id & time

In the time field I am using check boxes for each timeslot.

I want to use this multikey to show the bookings in a portal in another database. The problem is I can't create a calculation that gives me the multikey for room bookings

Eg

date - room - time

20030621 - 01 - 7

20030621 - 01 - 8

20030621 - 01 - 9

I have tried this:

[color:"red"] Substitute(time & " par.gif", " par.gif", date & room_id & time & " par.gif" )

But I can't get multiple entries separated by a carriage return.

I presume this is how multikeys work ?

Any help greatly appreciated!

Cheers

Darrel smile.gif

Posted

1. if you omit time, you don't need a multikey

date& room_id <-> date & room_id

2. i miss the hyphens in the calc

3. date is actually =year(date) & right("00" & month(date);2) && right("00" & day(date);2)

4.

the right calc would be:

substitue (" par.gif "& time", " par.gif ","[par] "& year(date) & right("00" & month(date),2) && right("00" & day(date),2) & "-" & room_id & "-")

Posted

Thanks Christian,

I've given it a try but all I seem to get from the calculation is a single line with the values.

For example, if I click the time field checkboxes for 8,9, and 10 o'clock all I get is 8910 in the substitution field. There is no date & room_ID information.

Sorry if I'm missing something obvious but it's still not working. Any more thoughts?

Thanks in advance

Darrel

Posted

If your "time"is a checkbox value list, then the field would look like :

Time =

7

8

9

If you concanation = 20030603 - 07

Then, you should have a Multikey =

c_Multikey = Substitute(Substitute(Time &" par.gif ", " par.gif ", "-"& Concanation& "par."), "par."," par.gif ")

Posted

Sorry for sounding stupid ... but it must be 'my understanding' of the multi key principle frown.gif

Your calculation works but I still get the time (in this case 8, 9 and 10 o'clock) as 8910-date & room_id

I thought a multikey for these three time slots would look like this

8 - date & room_id par.gif

9 - date & room_id par.gif

10 - date & room_id par.gif

So that the there would be three entries/times in this one field separated by a carriage return par.gif

I must be missing something in how it all works frown.gif

Thanks for your comments and patience..

Cheers

Darrel

Posted

also make sure, time is a text field.

using my calc, it should give you a leading return + the result you want. if you want to parse out the leading return for cosmetic reason, try Middle(Substitute( ....), 2, 999999).

for some reason, the shortcut [ par ] for par.gif does only work if enclosed by blanks . ..

This topic is 7896 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.