The code below is to display the order history for my module. I code it for the data grid view to display data/record according to the date selected by the user in the date time picker. It works fine but I wanted to format the date time to show in ddMMMyyyy format, is there any way I can achieve that?
strSQL = "Select INBKG_STSFG, Case INBKG_STSFG When 3 Then 'Complete' END AS STSFG, "
strSQL &= "INBKG_BKGID, INBKG_BKGDT, CONVERT(VARCHAR(10), INBKG_BKGDT, 103), INBKG_USRID, "
strSQL &= "INBKG_MATCD, INBKG_BKGQT, INBKG_RECID "
strSQL &= "FROM INBKG_TBL "
strSQL &= "WHERE INBKG_STSFG In ('3')"
strSQL &= "AND INBKG_BKGDT >= '" & gfSQLDate(dtBKGDT1.Value) & "'"
strSQL &= "ORDER BY INBKG_BKGDT, INBKG_RECID"
dt = ExecProc(strSQL)
CodePudding user response:
You can convert the DateTimePicker value as below.
dtBKGDT1.Value.ToString("dd/MMM/yyyy")