Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.
All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!
Table1
ClientID........BillAmt.....DateRec
1..................50...........01/01/2016
2..................100.........01/01/2016
3..................150.........01/02/2016
4..................200.........01/03/2016
5..................250.........01/04/2016
Table2
ClientID........InstallationFee.....DatePaid
6..................1,000..................01/01/2016
Query1
ClientID........BillAmt........InstallationFee....DateRec..................DatePaid
1..................50..............0........................01/01/2016............-
2..................100............0........................01/01/2016............-
6..................0................1,000................................................01/01/2016
SELECT
Table1.ClientID,
Table1.BillAmnt,
Table1.DateRec,
Table2.InstallationFee,
Table2.DatePaid,
FROM Table1 INNER JOIN Table2 ON Table1.ClientID = Table2.ClientID
WHERE Table1.DateRec=#01/01/2016# and Table2.DatePaid=#01/01/2016#
Guys pa help naman kung may idea kayo panu mag import ng details na nasa data report papuntang excel file?
Mas ok siguro na iexport yung query na binabato mo papuntang data report. kumbaga, ilagay mo sa datagrid yung ilalaman mo sa data report tsaka mo iexport.
Panu ko i export sir? wala kasi ako idea panu mapupunta sa excel un eh.. Thanks
May sample program kaba ng ginagawa mo? peram ako, try ko insert dun yung code.
Ayan sir. bali na sosort sya daily and monthly.. pero lalagyan ko sya ng button na mag sosort din sya pero pupunta na ng excel agad then i open nalang ung file para ma view. Thanks
Private Sub cmdExport_Click()
'ado_sales name ng adodc connection mo, rename mo na lang kung anong name ng gagamitin mo adodc.
If ado_sales.Recordset.RecordCount > 0 Then
Dim xl As Excel.Application
Dim fldCount As Integer
Dim recCount As Long
Dim iCol As Integer
Dim iRow As Integer
Set xl = New Excel.Application
With xl
.Workbooks.Add
.Worksheets(1).Name = "Export Daily"
' Copy field names to the first row of the worksheet
fldCount = ado_sales.Recordset.Fields.Count
For iCol = 1 To fldCount
xl.Cells(1, iCol).Value = ado_sales.Recordset.Fields(iCol - 1).Name
Next
Call .ActiveSheet.Range("A2").CopyFromRecordset(ado_sales.Recordset)
.Visible = True
End With
Else
MsgBox "No record(s) found.", vbOKOnly + vbExclamation, App.Title
End If
End Sub
Ito na yung request mo, add ka ng reference na Microsoft Excel 12.0 Object Library, add ka ng command button [cmdExport], insert mo itong code na ito.
Thank you sir! Thank you ng madami hehehe... ung pag sort nalang ng data bago papuntahin sa excel ung pproblemahin ko eheheh.. Thank you ulit..
Private Sub cmdExport_Click()
'ado_sales name ng adodc connection mo, rename mo na lang kung anong name ng gagamitin mo adodc.
ado_sales.RecordSource = "SELECT * FROMWHERE [Criteria] ORDER BY [field]"
ado_sales.Refresh
If ado_sales.Recordset.RecordCount > 0 Then
Dim xl As Excel.Application
Dim fldCount As Integer
Dim recCount As Long
Dim iCol As Integer
Dim iRow As Integer
Set xl = New Excel.Application
With xl
.Workbooks.Add
.Worksheets(1).Name = "Export Daily"
' Copy field names to the first row of the worksheet
fldCount = ado_sales.Recordset.Fields.Count
For iCol = 1 To fldCount
xl.Cells(1, iCol).Value = ado_sales.Recordset.Fields(iCol - 1).Name
Next
Call .ActiveSheet.Range("A2").CopyFromRecordset(ado_sal es.Recordset)
.Visible = True
End With
Else
MsgBox "No record(s) found.", vbOKOnly + vbExclamation, App.Title
End If
End Sub
Madali lang yun, i-update mo yung lang yung record source ng adodc mo via code, isama mo sa
cmdExport_Click na procedure
Example:
Kasi sir. dates ung i fifilter ko. then papunta sa excel file.. aun dko mapagana..
ung code ko is ito.
ado_sales.RecordSource = "SELECT * FROM [tbl_collection] WHERE [Date_Paid] BETWEEN '#" & txt_start_day.Text & "#' AND '#" & txt_end_day.Text & "#' ORDER BY Date_Paid"
ado_sales.Refresh
aun error. datatype mismatch. hehehhe
check mo yung Date_Paid mo sa database mo kung ano ang datatype, baka mamaya text ang nakalagay e as Date/Time mo siya tinatawag.
Tsaka wag text box gamitin mo sa pagpili ng date, gamit ka DTPicker na Object. Pag naconvert kasi and date sa text, hindi pang date format ang lumalabas,
example: yung 08/01/2016 pag naconvert siya sa text and magiging value niya ay 42583. Ayun. Kaya mas advisable na gumamit ng DTPicker pag dates ang concern mo,
Try mo din itong ganitong query:
'Assuming na DateFrom at DateTo ang value ng dalawang DTPicker na gagamitin mo.
ado_sales.RecordSource = "SELECT * FROM [tbl_collection] " & _
"WHERE [Date_Paid] >=#" & DateFrom.Value & "# and [Date_Paid] <=#" & DateTo.Value & "# ORDER BY Date_Paid"
Amazing ka sir. Thank you.