msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

recordcount per date ? HOw?

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax
Author Message
dokter cinta



Joined: 04 Oct 2007
Posts: 42

PostPosted: Wed Oct 04, 2006 11:57 pm    Post subject: recordcount per date ? HOw? Reply with quote

dear all
its me again....
how are you today ????

i have some problems again
i have some records per date
and i want to count it per date


here is the data


============================
date | pc
============================
01/01/2006 | pc01
01/01/2006 | pc01
01/01/2006 | pc01
01/01/2006 | pc01
01/01/2006 | pc01
02/01/2006 | pc01
02/01/2006 | pc01
03/01/2006 | pc01
03/01/2006 | pc01
03/01/2006 | pc01
04/01/2006 | pc01
=============================


look


on 01/01/2006 there is 5 record
on 02/01/2006 there is 2 record
on 03/01/2006 there is 3 record
on 04/01/2006 there is 1 record


i only know how to show all recordcount
========================================
Set rsRoom = New Recordset
rsRoom.ActiveConnection = con
rsRoom.CursorType = adOpenStatic
rsRoom.CursorLocation = adUseClient
rsRoom.LockType = adLockOptimistic
rsRoom.Open "select * from Room"


lblcount.caption = rsroom.recordcount
========================================


the problem is what the code to count it per date?
so if i choose the date between 01/01/2006 until 18/01/2006
i will know how much recordcount per date on 01/01/2006 , 02/01/2006,
03/01/2006, and ....
here is my code
=========================================


start1 = DTPicker1.Value
start2 = DTPicker2.Value
strsql = "select * from room where date between #" & Format(start1,
"MM/dd/yyyy") & "# AND #" & Format(start2, "MM/dd/yyyy") & " #"


Set rsRoom = New Recordset
rsRoom.ActiveConnection = con
rsRoom.CursorType = adOpenStatic
rsRoom.CursorLocation = adUseClient
rsRoom.LockType = adLockOptimistic
rsRoom.Open strsql
lblcount.caption = rsroom.recordcount


'please help me the code to count it per date


==========================================


thanks


best regards


THE VB LOVERS FROM ASIA

Archived from group: microsoft>public>vb>syntax
Back to top
View user's profile Send private message
Jan Hyde



Joined: 04 Oct 2007
Posts: 1211

PostPosted: Thu Oct 05, 2006 1:21 pm    Post subject: Re: recordcount per date ? HOw? Reply with quote

"dokter cinta" 's wild thoughts were
released on 4 Oct 2006 19:57:14 -0700 bearing the following
fruit:

>dear all
>its me again....
>how are you today ????
>
>i have some problems again
>i have some records per date
>and i want to count it per date

What your looking to add to you SQL is 'GROUP BY'



Jan Hyde (VB MVP)

--
People who live in the mountains have their own viewpoint. (Mike Bull)

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Date greater than another date I have 2 Access tables - one network version and one local. 2 date fields both set up in Access as date/time fields and populated with general dates showing date and time. Using VB6 code, I want to upload everything new the from local table up to network

Getting Age from Date of Birth How would I write a function that would return the age of a person given their date of birth?? I'm assuming this isn't an uncommon request, and I'm sure there is a quicker way to write it than how I would. Any help is greatly appreciated! Best Regards, B

Date Range Hi All, I need to check if a date entered is within a date range specified by two MonthView controls - MonthView(0), which controls the beginning of the range, and MonthView(1), which controls the end of the range. Also, if the date entered is +1 day fro

Date Time Hi, How to add for example two days in date selected in For example the is 12/2/2004, I want to add 2 days so become 12/4/2004. Thanks

Adding the rd, th etc to a date Hello all. I want to make a date on a report look like a real date, that is, in England we say Tuesday 26th October 2004. Using the Format function, I can say Tuesday 26 October 2004 thus: Label2 = "Survey Closing : " & "dddd dd MMMM YYYY"
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group