Results 1 to 5 of 5

Thread: Database question

  1. #1

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Database question

    I have three columns product1 and prodcut2 and amount. i want that in amount columns the sum of pro1 and pro2 should add. should i slect query in mdb database 2000.
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: Database question

    CONNECT the database via vb and u can update all the record of the amout with the sum of both the field....

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Database question

    Quote Originally Posted by vivek_master146
    I have three columns product1 and prodcut2 and amount. i want that in amount columns the sum of pro1 and pro2 should add. should i slect query in mdb database 2000.
    Why?

    Storing calculated answers is a waste of database space. You don't need the amount field if the contents that would be stored in it is ALWAYS the sum of the other two fields.

    When you retrieve data on product1 one and product2 two, programmtically do the calculations then, on the fly, and do whatever you need with the result.

  4. #4
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: Database question

    @ vivek i think that hack is correct

  5. #5

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Database question

    I know that i can do it by getting the values. but is there a way to do that.
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

Posting Permissions

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



Click Here to Expand Forum to Full Width