Hi all,

I have a range on a query:
qry.addDataSource(tablenum(CustInvoiceJour)).addRange(fieldnum(CustInvoiceJo
ur, InvoiceDate));

I use this value:
dateRange =
qryRun.query().dataSourceTable(tablenum(CustInvoiceJour)).rangeField(fieldnu
m(CustInvoiceJour, InvoiceDate)).value();

This value is returned as a string. But I need to extract the exact dates
for a fromDate and a toDate as Date values
to use in:
while select custTrans
    order by TransDate asc, Voucher asc
    where custTrans.AccountNum == custAccount
    && custTrans.TransDate >= fromDate && custTrans.TransDate <= toDate
    outer join * from custInvoiceJour
    where custInvoiceJour.InvoiceId == custTrans.Invoice
    && custInvoiceJour.InvoiceDate == custTrans.TransDate
    && custInvoiceJour.LedgerVoucher == custTrans.Voucher

I use a method to extract the dates,
if (dateRangeValue)
    {
    i = 1;
    fromDateStr = SubStr(dateRangeValue, i + 1, 10);
    fromDate = str2date(fromDateStr,123);

    if ((strlen(dateRangeValue) > (i + 11)))
    {
        j = strfind(dateRangeValue, "..", i + 1, strlen(dateRangeValue));
        toDateStr = SubStr(dateRangeValue, j + 2, 10);
        toDate = str2date(toDateStr,123);
    }
    else toDate = fromDate;
    }
    else
    {
         fromDate = systemDateGet();
         toDate =  systemDateGet();
    }

but the problem is the users can supply wrong info "mm/dd/yy" or "mmddyyyy"
ext
instead of the "dd/MM/yyyy" used is the method...

QUESTION:
Do Axapta have build in functionality to help with this????

Regards

Niel
----
Daniel J. Redelinghuys
UTi - Sun Couriers
[EMAIL PROTECTED]
Phone: +27 12 673,2355
Fax: +27 12 673,2344






YAHOO! GROUPS LINKS




Reply via email to