Hi all,
Relative beginner at Access stuf here.. but at work they saw fit to let me fix a small existing db that is currently malfunctioning. Most stuf I've got working but I'm running into one problem I'm not sure how to solve.
I've got a form that needs to be sorted numerically on data from column A from table dataset containing strings. The strings consist of both letters and numbers. No uniform order or number of characters. Sou we could get strings like: v81, v100, v10, v01, v2, 11.0047, 2009/129, 2009-129, 2007.212, 2012.05.08Z
My predecessor tried to solve this by creating a B in the forms source like this:
SELECT dataset.organisatie, dataset.AIP, dataset.EDNA, dataset.dataset, dataset.A, IIf([a]<>"",Val([A])) AS B, dataset.C, dataset.D, dataset.E, dataset.PID FROM dataset;
This obviously won't work since it will not recognise de v numbers and sorting the string as is will give you 10, 100, 20, 200 etc instead of 10, 20, 100, 200
So I guess I need to extract the numerical data somehow and sort on that... I haven't got a clue how to do it though. Can it be done by queries or is it better to resort to visual basic for instance? Anyway any sugestions would be more than welcome
Relative beginner at Access stuf here.. but at work they saw fit to let me fix a small existing db that is currently malfunctioning. Most stuf I've got working but I'm running into one problem I'm not sure how to solve.
I've got a form that needs to be sorted numerically on data from column A from table dataset containing strings. The strings consist of both letters and numbers. No uniform order or number of characters. Sou we could get strings like: v81, v100, v10, v01, v2, 11.0047, 2009/129, 2009-129, 2007.212, 2012.05.08Z
My predecessor tried to solve this by creating a B in the forms source like this:
SELECT dataset.organisatie, dataset.AIP, dataset.EDNA, dataset.dataset, dataset.A, IIf([a]<>"",Val([A])) AS B, dataset.C, dataset.D, dataset.E, dataset.PID FROM dataset;
This obviously won't work since it will not recognise de v numbers and sorting the string as is will give you 10, 100, 20, 200 etc instead of 10, 20, 100, 200
So I guess I need to extract the numerical data somehow and sort on that... I haven't got a clue how to do it though. Can it be done by queries or is it better to resort to visual basic for instance? Anyway any sugestions would be more than welcome