-
VB Data Reports
I'm using VB datd Reports to create Reports & have given the user an option to choose from the following three:
1) Daily Reports
When the user chooses this option, I save it to the registry and when the program is being closed it looks for the option that is selected and if this is the chosen one...then the report is generated.
2) Weekly Reports in this My sql query will change to something like this: "Select * from Table1 where Date > today < 7days...how do I write this query? And lets say user chooses weekly reports today...and till today he was having Daily reports...how do I count number of days...pls suggest ways...
In other words I'm asking, if a user switches to Weekly reports, do I start counting days from today...or shall I start counting from every Monday....and please help me doing this. I have no clue how to count days...
-
I was just thinking about it, and if for example lets say...a user chooses daily reports at first...this option is no problem at all. But lets say that user changes from daily reports to weekly reports, what I would like is, that from the day he changes to Weekly...to the coming Saturday...a report is generated...and then from Monday-Saturday...a weekly report....is generated....Please help me...how to get this moving?
-
Could someone help me in writing a Query that will get data between two dates...Like getting all the transactions between Date1 & Date2...
-
Your SQL would look something like this:
Code:
SELECT * FROM TABLE1 WHERE MYDATEFIELD BETWEEN '12/01/2002' AND '12/07/2002'
-
For a datareport use this:
Private Sub Command1_Click()
If DataEnvironment1.rsITDS.State = adStateOpen Then DataEnvironment1.rsITDS.Close
DataEnvironment1.Commands("ITDS").CommandType = adCmdText
DataEnvironment1.Commands("ITDS").CommandText = "SELECT * FROM ITDS WHERE [DATE] BETWEEN #" & Text1.Text & "# AND #" & Text2.Text & "# order by date "
DataEnvironment1.ITDS
DataReport2.DataMember = "ITDS"
DataReport2.PrintReport
'allows a refresh with new data without having to close the report first.
DataReport2.Refresh
Exit Sub
just set the two different dates in the textbox.;)