Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2014

    Wink Unanswered: How to assign a constant value for the first few record in a field?

    As mentioned in the title, I'd like to assign a constant value for the first few record in a field.
    what was required by my assignment is mileage rate for every customer will become 0.9 when they have more than 4 records.
    In my attachment below, ticketNo represent customer ID, and bookingID represent their transaction record indexes.
    *BookingID 6 is the first record in my project
    Attached Thumbnails Attached Thumbnails image.JPG  

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    set an appropriate default for new rows
    when a row is added for a ticket no run an update query for that ticket no

    update mytable set [mileage rate] = 0.9 where count([ticket no] = avalue
    change mytable for whatever the right name should be
    a value should be the the ticket number of the row you have just changed

    I'm suspicious of your table design.. its doesn't seem right to me. I would expect the mileage rate to be fixed/associated with a specific person/vehicle NOT with a specific journey. it doesn't sound as if your table design is normalised

    do your self a favour get rid of the spaces between column and table names its not compliant with the ANSI standard SQL.

    if you want human legible titles set the appropriate property in the columns definisiton in table design
    I'd rather be riding on the Tiger 800 or the Norton

Tags for this Thread

Posting Permissions

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