| | |
need help
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
•
•
Originally Posted by gentleman4u
how to generate monthly basis reports and there sum
plz give me complete code i know SQL query but how to use it in vb.net plz give complete refrence with code.....thanks
First off, you are not going to get code just like that. Why? Well their needs to be effort on your part, we will help you here, but we will NOT do the work for you.
Secondly, you have provided us with no details that would even slightly enable us to produce code for you (see First reason).
Provide the code you have tried and is not working the way you want, and we can help you through the problems you are having.
Making requests like this...will get you little or no help at all.
•
•
Join Date: Jun 2006
Posts: 6
Reputation:
Solved Threads: 0
hello exoerts
well well well my fault i didnt send u the whole detail..i am sorry for that.......well now i am sending my code whihc i wrote for monthly basis report generation.....but it gives error of that function i used datepart function and it gives error of that datepart function needs 2 arguments......now i dont know about this error that how to correct it.......i used date time picker for using values between 2 date....
now plz correct that code for me or give me additional things it for it and how i can generate its some on monthly basis........so nice of you that u read my question and replied mee..........waiting for your reply
and the code that i used for it is ..........( dt1 and dt2 are the date time picker i used where vdate is the field name in the table and invoice is the table name).........now plz review it and tell me what is the problem in this code and how can i generate monthly basis report for it or how can i generate report between 2 date given at run time and there sum also
well well well my fault i didnt send u the whole detail..i am sorry for that.......well now i am sending my code whihc i wrote for monthly basis report generation.....but it gives error of that function i used datepart function and it gives error of that datepart function needs 2 arguments......now i dont know about this error that how to correct it.......i used date time picker for using values between 2 date....
now plz correct that code for me or give me additional things it for it and how i can generate its some on monthly basis........so nice of you that u read my question and replied mee..........waiting for your reply
and the code that i used for it is ..........( dt1 and dt2 are the date time picker i used where vdate is the field name in the table and invoice is the table name).........now plz review it and tell me what is the problem in this code and how can i generate monthly basis report for it or how can i generate report between 2 date given at run time and there sum also
Dim ds1 As New DataSet If cn.State = ConnectionState.Open Then cn.Close() End If cn.Open() Try With da .SelectCommand = New OleDbCommand .SelectCommand.Connection = cn .SelectCommand.CommandText = "select * from invoice where datepart(vdate) = '" & dt2.Value & "' between '" & dt3.Value & "' " .Fill(ds1, "invoice") End With Dim obj As New crv2 'obj.RecordSelectionFormula = "{invoice.vdate}= '" & dt2.Value & " ' " rpt2.ReportSource = obj rpt2.Refresh() Catch ex As Exception MsgBox(ex.Message) End Try
•
•
•
•
Originally Posted by Paladine
First off, you are not going to get code just like that. Why? Well their needs to be effort on your part, we will help you here, but we will NOT do the work for you.
Secondly, you have provided us with no details that would even slightly enable us to produce code for you (see First reason).
Provide the code you have tried and is not working the way you want, and we can help you through the problems you are having.
Making requests like this...will get you little or no help at all.
Last edited by Paladine; Jun 10th, 2006 at 12:27 pm. Reason: Incorrect quote tags
•
•
Join Date: Jun 2006
Posts: 6
Reputation:
Solved Threads: 0
hello experts
well well well my fault i didnt send u the whole detail..i am sorry for that.......well now i am sending my code whihc i wrote for monthly basis report generation.....but it gives error of that function i used datepart function and it gives error of that datepart function needs 2 arguments......now i dont know about this error that how to correct it.......i used date time picker for using values between 2 date....
now plz correct that code for me or give me additional things it for it and how i can generate its some on monthly basis........so nice of you that u read my question and replied mee..........waiting for your reply
and the code that i used for it is ..........( dt1 and dt2 are the date time picker i used where vdate is the field name in the table and invoice is the table name).........now plz review it and tell me what is the problem in this code and how can i generate monthly basis report for it or how can i generate report between 2 date given at run time and there sum also
this is the whole code i written for it........i am new in market plz also send me the suggetions and tips that how can i make my softwares very very much better your reply will be appritiated
well well well my fault i didnt send u the whole detail..i am sorry for that.......well now i am sending my code whihc i wrote for monthly basis report generation.....but it gives error of that function i used datepart function and it gives error of that datepart function needs 2 arguments......now i dont know about this error that how to correct it.......i used date time picker for using values between 2 date....
now plz correct that code for me or give me additional things it for it and how i can generate its some on monthly basis........so nice of you that u read my question and replied mee..........waiting for your reply
and the code that i used for it is ..........( dt1 and dt2 are the date time picker i used where vdate is the field name in the table and invoice is the table name).........now plz review it and tell me what is the problem in this code and how can i generate monthly basis report for it or how can i generate report between 2 date given at run time and there sum also
Dim ds1 As New DataSet If cn.State = ConnectionState.Open Then cn.Close() End If cn.Open() Try With da .SelectCommand = New OleDbCommand .SelectCommand.Connection = cn .SelectCommand.CommandText = "select * from invoice where datepart(vdate) = '" & dt2.Value & "' between '" & dt3.Value & "' " .Fill(ds1, "invoice") End With Dim obj As New crv2 'obj.RecordSelectionFormula = "{invoice.vdate}= '" & dt2.Value & " ' " rpt2.ReportSource = obj rpt2.Refresh() Catch ex As Exception MsgBox(ex.Message) End Try
this is the whole code i written for it........i am new in market plz also send me the suggetions and tips that how can i make my softwares very very much better your reply will be appritiated
Last edited by Paladine; Jun 10th, 2006 at 12:27 pm.
Him, well I think the problem is DatePart. It is telling you it requires two parameters, and if you go to MSDN and search on DatePart function here is what you will find:
Link http://msdn.microsoft.com/library/de...ctdatepart.asp
Parameters
So you simply have to provide a little more detail on that Part of the Date you want to extract from the date selected in the DatePicker.
Hope this helps
Link http://msdn.microsoft.com/library/de...ctdatepart.asp
Parameters
- Interval expression representing the part of the date/time value you want to return. Required. DateInterval enumeration value or String
- DateValueRequired. Date value that you want to evaluate.
- FirstDayOfWeekValue Optional. A value chosen from the FirstDayOfWeek enumeration that specifies the first day of the week. If not specified, FirstDayOfWeek.Sunday is used.
- FirstWeekOfYearValue Optional. A value chosen from the FirstWeekOfYear enumeration that specifies the first week of the year. If not specified, FirstWeekOfYear.Jan1 is used.
So you simply have to provide a little more detail on that Part of the Date you want to extract from the date selected in the DatePicker.
Hope this helps
Last edited by Paladine; Jun 8th, 2006 at 12:09 am.
•
•
Join Date: Jun 2006
Posts: 6
Reputation:
Solved Threads: 0
well dear this didnt solve my prob if u know alternative way soo plzzz telll me it solve my prob as well my time because i already lost too much time on it,i am searching for vb.net teachers in my country in Pakistan but i didnt get any respose nor help i am in prob plz Experts team solve my prob i am requesting u........
waiting for reply
waiting for reply
You have to supply the DatePart Function a second parameter. It requires TWO. one for the date part enumeration (the portion of the date you want to pull out of the supplied date), and the supplied date (from the date picker).
Expert Team?
Expert Team?
•
•
Join Date: Jun 2006
Posts: 6
Reputation:
Solved Threads: 0
well thanks expert team it solve some of my prob but tell me how can i pick up reports on sql query basis bcz it works in sql but doesnt shows any result there would be a single command plz tell me that or if just ignore the sql query method hten its possible for to do it with record selection formula........i just wrriten code here plz tell me for this...........the prob is that i used also record selection formula then it gives arror that "remaining part of text is not a part of this" so wats this prob.........solve this also i know it was a time problem when picking it from database how it can be solve and how i can rid of this itme prob..........
Dim ds1 As New DataSet If cn.State = ConnectionState.Open Then cn.Close() End If cn.Open() Try With da .SelectCommand = New OleDbCommand .SelectCommand.Connection = cn .SelectCommand.CommandText = "select * from invoice where datepart(vdate) = '" & dt2.Value & "' between '" & dt3.Value & "' " .Fill(ds1, "invoice") End With Dim obj As New crv2 'obj.RecordSelectionFormula = "{invoice.vdate}= '" & dt2.Value & " ' " rpt2.ReportSource = obj rpt2.Refresh() Catch ex As Exception MsgBox(ex.Message) End Try
Last edited by Paladine; Jun 10th, 2006 at 12:28 pm.
•
•
•
•
Originally Posted by gentleman4u
well thanks expert team it solve some of my prob but tell me how can i pick up reports on sql query basis bcz it works in sql but doesnt shows any result there would be a single command plz tell me that or if just ignore the sql query method hten its possible for to do it with record selection formula........i just wrriten code here plz tell me for this...........the prob is that i used also record selection formula then it gives arror that "remaining part of text is not a part of this" so wats this prob.........solve this also i know it was a time problem when picking it from database how it can be solve and how i can rid of this itme prob..........
Dim ds1 As New DataSet
If cn.State = ConnectionState.Open Then
cn.Close()
End If
cn.Open()
Try
With da
.SelectCommand = New OleDbCommand
.SelectCommand.Connection = cn
.SelectCommand.CommandText = "select * from invoice where datepart(vdate) = '" & dt2.Value & "' between '" & dt3.Value & "' "
.Fill(ds1, "invoice")
End With
Dim obj As New crv2
'obj.RecordSelectionFormula = "{invoice.vdate}= '" & dt2.Value & " ' "
rpt2.ReportSource = obj
rpt2.Refresh()
Catch ex As Exception
MsgBox(ex.Message)
End Try
"..how can i pick up reports on sql query basis bcz it works in sql but doesnt shows any result there would be a single command plz tell me that or if just ignore the sql query method hten its possible for to do it with record selection formula."
Reports are always based on an SQL basis from a database.
What works in SQL? The Select statement? It should work in both ASP.Net and SQL (with minor language modification differences).
Here is a thought, if the following code is not pulling the results you want:
VB.NET Syntax (Toggle Plain Text)
.SelectCommand.CommandText = "select * from invoice where datepart(vdate) = '" & dt2.Value & "' between '" & dt3.Value & "' " .Fill(ds1, "invoice")
If it doesn't then their is a flaw in the SQL statement.
Single Statement? For what? When speaking about a query, it is extremely helpful if you provide the table structure (for the tables involved in your query) for us to help you.
REMEMBER: we are not working on the same project as you, so you have to be very specific and concise about what you are trying to do and what you are having problems with..
And always, use breakpoints in your code and walk through it, to be certain the values being passed are what you think they are. Thinking you coded it and it will work, without walking through it (even on paper) is far more time consuming because you are working on a false assumption.
Your statement above states a few things, but all in a very very vague way. So please provide concise points, rather than long run on sentences speaking from a level which would only make sense if we were working on the project.
Lastly, please use code blocks around your code:
[ code] ' code [ /code]
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Basic of VB.net
- Next Thread: Again here for help
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account add application array basic beginner browser button buttons center check click code combo cpu crystalreport cuesent database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic dropdownlist excel exists fade file-dialog filter forms ftp generatetags html images input insert intel listview mobile module monitor mysql net number open output panel passingparameters picturebox picturebox2 port print printing printpreview problem regex reuse right-to-left searchvb.net select settings shutdown socket sqldatbase sqlserver storedprocedure survey tcp temperature textbox timespan transparency trim txttoxmlconverter user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet vista visual visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year





