Jorgen Posted March 23, 2008 Share Posted March 23, 2008 Hi There, I'm have a database with musicfiles and they always come up sorted on artist, title or year. Is there a way within an extra field to create automatically a random number (witch changes now and then) so i can sort on that random number? Thanks Jorgen Quote Link to comment Share on other sites More sharing options...
Weetbicks Posted March 23, 2008 Share Posted March 23, 2008 Create a new calculation field on the table, and set it to the function called Random. Then sort on this field. Quote Link to comment Share on other sites More sharing options...
Maarten Witberg Posted March 23, 2008 Share Posted March 23, 2008 This should be an unstored calc then I think. If your database is (very) large and you only incidentally want to change the sort order using this method, a scripted solution might be the way to go. the random sort field would then be a number field, and the script would be go to layout [ your layout ] freeze window replace field contents [ RandomSortField ; by calculation, =Random ] sort [ restore ] Quote Link to comment Share on other sites More sharing options...
Jorgen Posted March 23, 2008 Author Share Posted March 23, 2008 Create a new calculation field on the table, and set it to the function called Random. Then sort on this field. Thanks, this working fine Didn't new is was so easy See further under Tnx Jorgen Quote Link to comment Share on other sites More sharing options...
Jorgen Posted March 23, 2008 Author Share Posted March 23, 2008 This should be an unstored calc then I think. If your database is (very) large and you only incidentally want to change the sort order using this method, a scripted solution might be the way to go. the random sort field would then be a number field, and the script would be go to layout [ your layout ] freeze window replace field contents [ RandomSortField ; by calculation, =Random ] sort [ restore ] I've done the first thing. I created a new file reference with 2 field. One is a a relation field (=tracknumber) wich is connected to the main database. The second one is the random field. This one is now filled up with random numbers. How can i change all random numbers within a script? The reason why: I would like to make a shuffle button so the sort would be different everytime i push this button. Is there a way to create this solution? Many thanks Jorgen Quote Link to comment Share on other sites More sharing options...
Jorgen Posted March 23, 2008 Author Share Posted March 23, 2008 Thanks Kjoe and Weetbix for helping me out. I made the best out of both answers! Works fine with one button! Regards Jorgen Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.