Awesome thanks again that worked. I didn't think of using the #sub code that's neat. So query syntax is for the whole library and standard formatting is for active playlists, I have both now I was going to remove the autoplaylists for most played, rated, last added etc but that does the whole library so it's still useful rather than having to select the entire library in filters.
I've settled on this so far.
length=%length%;file path=%path_sort%;artist=%artist%;album artist=%album artist%;album=%album%|%discnumber%|%tracknumber%;track number=%discnumber%|%tracknumber%;title=%title%;date=%date%;added=$sub(99999999999999,$replace(%added%,'-',,':',,' ',));rating=$sub(5,%rating%)|%album%;play count=$sub(999,%play_count%);last played=$sub(99999999999999,$replace(%last_played%,'-',,':',,' ',))
I don't think there is any other sort by fields I need, do you know any good ones?