First function Access

  • hi im migratting an MS Access database to SQL Server 2008, and I have a trouble trying to convert the first function from Access to T-SQL in this query:

    Select Pay_table.register,First(Pay_table.type),First(Pay_table.key),

    First(Pay_table.Idleacv1),Pay_table.n_row,Pay_table.n_exercise,

    Pay_table.c_n_period,First(Pay_table.fperceh1),

    First(Pay_table.d_hpresentation),First(Pay_table.tdiepco1),

    First(Pay_table.f_previous_pay),First(Pay_table.gain),

    First(Pay_table.lost),First(Pay_table.c_key_det)

    From Pay_table

    Group by Pay_table.register,Pay_table.n_row,Pay_table.n_exercise,

    Pay_table.c_n_period

    Order by Pay_table.register,

    Pay_table.n_exercise,First(Pay_table.fperceh1) Desc,

    First(Pay_table.d_hpresentation) Desc;

    An example of the data type of the columns is this

    register type key Idleacv1 n_row n_exercise

    AAAAA111111 F 40012-601513 40012-601513-4 21 2011

    c_n_period fperceh1 d_hpresentation tdiepco1 f_previous_pay

    1 31/01/2011 6:15:00 am 1 18/07/2011

    gain lost c_key_det

    1632 10016 851536

    Can Anyone help me please?

  • Repeated post. Follow on http://www.sqlservercentral.com/Forums/Topic1371167-392-1.aspx

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Duplicate post. Please post any responses here.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply