Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Apr 2009
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a column in my ISQL query that I need to format. It currently returns a value like 222.55. I need it to be formatted with 10 varchars like 000002255.

    Any help would be greatly appreciated.

    Thanks,
    Cindy

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You'd need to multiply the value with 100 in the SELECT statement, and format it using a COLUMN statement, e.g.

    COLUMN fieldname FORMAT "0999999999"

  3. #3
    New Lounger
    Join Date
    Apr 2009
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I tried that and it didn't work. Here is my query:

    The d.amount column should be "0999999999" as well as the d.printed_check_num.

    Thanks,



    select '"CK",'||'"'+g.bank_Acct_Num+'",',
    d.printed_check_num,
    '"'+dateformat(d.tran_date,'mm')+dateformat(d.tran _date,'dd')+dateformat(d.tran_date, 'yyyy')+'",',
    d.amount,'"'+d.payee_name+'",' ||'"",'||'"",'||'"'+d.address_line_1+'",'||'"'+d.a ddress_line_2+'",'||'"'+d.city+'",'||'"'+d.state+' ",'||'"'+d.zip+'",'||
    '"'+d.memo+'",'||'"'+e.SSN_or_FEIN+'"'
    from disburse d, entity e, GL_Acct g,
    where d.tran_Date = '2009-03-10*'
    and g.Master_Acct_Code = d.Master_Acct_Code
    and d.entity_id = e.entity_id
    and d.payment_method = 'Check'
    order by d.printed_check_num

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I'm afraid that I don't know much about SYBASE SQL. I can't find any function equivalent to the VBA Format function.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •