Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2005
    Location
    Brooklyn, ny
    Posts
    69

    Unanswered: Divide currenct data in a table

    Hello,
    Is there a way to Divide data by 10 in access table using SQL, the column contain currenct data?

    Thank you

  2. #2
    Join Date
    Sep 2005
    Location
    Brooklyn, ny
    Posts
    69
    Problem is solved by aggregate functions/calculate fields

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    create a query
    update <mytable> set <mycolumn>=<mycolumn>/10 where not isnull(<mycolumn>)
    I'm away form an Access box so it could be instead
    update <mytable> set <mycolumn>=<mycolumn>/10 where <mycolumn> <> NULL

    you can probably recreate the same thing in the query designer
    by selecting the right table
    drag the required column onto the datagrid
    set the criteria = NOT NULL
    set the value = <mycolumnname>/10

    if you know there are no null values then you cna safely ignore the where clause thinking about it JET probably ignores 'em anyway.

    this assumes that the column <mycolumn> is numeric and real
    you may need to explicitly cast the data type, and or use rounding fucntions like floor / fix / round etc....
    eg
    update <mytable> set <mycolumn>=cint(<mycolumn>/10) where <mycolumn> <> NULL
    HTH

Posting Permissions

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