Hello Guys I Have A Question..

I have a Table for My Daily Reports..

But I dont know to Show the Daily, Weekly, Monthly and Annual Reports.

What Should I do?

Recommended Answers

All 13 Replies

just compare dates using datetime.datediff function

and now i hope that you can handle the issue

how to determine sir? can you give an example to determine.

for example
if you wanna see data (weekly) then just do following


And it will result in last week from specified date (old_date) , and similar method will be applicable for months , year and so on . . .

now one more thing may be helpful for you and that is proper use of format function , if you wanna use date as dd/mm/yyyy then use the following

Format(Date, "dd/mm/yyyy")

the above method will produce date in dd/mm/yyyy format

now lets come to the topic And for this you need a sql query that is capable to fulfill your requirements now have following:-

"select * from tbl where field_name between 'start_date' and 'end_date'"

the above sql statment will result all those records which having a date star from 'start_date' upto 'end_date'

replace tbl,field_name,start_date,end_date(which are for example purpose only) with your requirements

hope this helps for you . . .

thanks Sir

its my pleasure
if you got an answer then marks the post as solved

Hello Sir In y db the format of the date is like this mm/dd/yyyy then i have many reports..

then i want to show my report in weekly then daily what should i do.. In my Mind I want to use like this.

rs.Open "Select * from ProductInfo where purchase_date ='" & datepicker.value & "'", acd, adOpenForwardOnly

first you have to determine that from which date a week should be considered

and then add 7 to that date

and now implement select query what i showed in my previous post

and still having problems then specify your problem in more clear way

and at last i assume that you know how to create a simple data report

happy coding

Sir In your Previuos Post I don't Understand why u are using


can u explain me why?

i used updated_date=old_date-7 , because it takes 7 days back (i.e a week back)
and further at query part you can use it

"select * from tbl where field_name between 'updated_date' and 'old_date'"

hope this helps you to sove the issue . . .

thanks sir ill try my best to solve this issue ^_^

Sir I use this Code for daily record then vb 6 says. Type mismacth Help me Sir

 Dim listx As ListItem
Dim rs As New ADODB.Recordset

If DTPicker1.Value = "" Then
    MsgBox "The Date Field is Empty.", vbExclamation, "Details"
    rs.Open "Select * from Dailyrecord where purchase_date = '" & DTPicker1.Value & "'", acd, adOpenForwardOnly
If rs.RecordCount = 0 Then
        MsgBox "The Date you Select Does Not Exist!", vbExclamation, "Details"
        txtno1.Text = ""
While rs.EOF <> True
Set listx = ListView1.ListItems.Add(, , rs.Fields("Receipt"))

listx.SubItems(1) = rs.Fields("BarCode")
listx.SubItems(2) = rs.Fields("ProductName")
listx.SubItems(3) = rs.Fields("Quantity")
listx.SubItems(4) = rs.Fields("Price")
listx.SubItems(5) = rs.Fields("TotalPrice")
listx.SubItems(6) = rs.Fields("purchase_date")

End If
ListView1.Enabled = True
End If

As per your new thread, your select statement was incorrect. Please correct to the sample I gave you there. If this is answered, please mark as solved, thanx.

Thanks Sir. Im USe LIKE to Identify the date, month and a Year in My db. And My Problem solved.. Thanks for Helping and the Wonderful Idea..

Only a pleasure. Happy coding.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.