Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filtering data with vfp 8

bharons

Technical User
Jan 23, 2019
54
ID
can someone help me.. with my code because it wont show up data at my grid vfp 8..
below code that i use at my command button vfp 8 to filtering smalldatetime on sql server

Code:
Local lcSQL, lcColumnname, lcValue1
lcColumnname1 = thisform.cmbKeyColumn.value
*lcValue1 = date(year(thisform.txtTanggal.value),month(thisform.txtTanggal.value),day(thisform.txtTanggal.value))
*lcValue1 = ttod(thisform.tanggal.value)
lcValue1 = thisform.tanggal.value

Use In (Select('crsSampleData'))
TEXT TO m.lcSQL TEXTMERGE noshow
SELECT TOP(100) * from << TRIM(crsTables.TableName) >>
where << (m.lcColumnname1) >> = ?m.lcValue1
ENDTEXT

SQLExec(Thisform.nHandle, m.lcSQL ,'crsSampleData')
With Thisform.grid1
    .DeleteMark = .F.
    .ColumnCount = -1
    .RecordSource = "crsSampleData" && Main Database Opened
    .AutoFit()

    Local ix
    For ix = 1 To .ColumnCount
        Bindevent( Getpem(.Columns(m.ix),'Text1'), 'DblClick', Thisform, 'TableNameDblClick')
    Endfor
Endwith

if smalldatetime sql server like this date 27/03/2025 00:00:00, the grid vfp 8 show up the data is. but if 27/03/2025 13:01:41, the grid vfp dont show up the data is..
 

Part and Inventory Search

Sponsor

Back
Top