H
Houssem12
Guest
Hi members
i want make a select query which will get the last record from database using a column date
i tried but didnt work
Dim com As New SqlCommand("select DO_Type,CT_Num,DO_Piece,DL_PieceBC,DL_PieceBL,DO_Date,DL_DateBC,DL_DateBL,DL_Ligne,DO_Ref,AR_Ref,DL_Design
,DL_Qte,DL_PrixUnitaire,DL_PUBC,DL_PrixRU,DL_CMUP,DL_TTC,date_saisie from F_DOCLIGNE where do_domaine='1' and do_type='13' and ar_ref='CR2615_BERCO' and
date_saisie < '" & DateTimePicker1.Value & "' and date_saisie =
(select max(date_saisie) from f_docligne where do_domaine='1' and do_type='13' and ar_ref='CR2615_BERCO' and
date_saisie < '" & DateTimePicker1.Value & "')", cn)
i think my idea work with other datatype then date
please help
Continue reading...
i want make a select query which will get the last record from database using a column date
i tried but didnt work
Dim com As New SqlCommand("select DO_Type,CT_Num,DO_Piece,DL_PieceBC,DL_PieceBL,DO_Date,DL_DateBC,DL_DateBL,DL_Ligne,DO_Ref,AR_Ref,DL_Design
,DL_Qte,DL_PrixUnitaire,DL_PUBC,DL_PrixRU,DL_CMUP,DL_TTC,date_saisie from F_DOCLIGNE where do_domaine='1' and do_type='13' and ar_ref='CR2615_BERCO' and
date_saisie < '" & DateTimePicker1.Value & "' and date_saisie =
(select max(date_saisie) from f_docligne where do_domaine='1' and do_type='13' and ar_ref='CR2615_BERCO' and
date_saisie < '" & DateTimePicker1.Value & "')", cn)
i think my idea work with other datatype then date
please help
Continue reading...