Sir,
Where do you have the dates located? Is it a column in your database? You may want to use the DBGetParamAttribute function with the ATTR_DB_PARAM_VALUE to compare the values of the parameter and then do a sort according to the date values. More information on this function is provided in the manual, which you can download at http://digital.ni.com/manuals.nsf/websearch/D3DF4019471D3A9386256B3C006CDC78?OpenDocument&node=132100_US
Please let me know if I have misunderstood your question. Thanks, and have a great day.
Daniel McChane
Application Engineer
National Instruments