If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Other PC Databases > visual foxpro 6

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-26-08, 14:58
sbouton sbouton is offline
Registered User
 
Join Date: Aug 2008
Posts: 1
visual foxpro 6

First I am not a programer
I have a database that has a field called docdate2 - it is a date field. I am trying to get a count of records between two date (example 1/1/06 and 12/31/06)
Does anyone have any ideas what command I would type to do this?
Thanks
Reply With Quote
  #2 (permalink)  
Old 08-27-08, 18:50
jrbbldr jrbbldr is offline
Registered User
 
Join Date: Nov 2002
Posts: 49
There are a variety of ways to get a count of records.

One approach would be to run the COUNT command on your data table (note - not 'database'):
SELECT MyTable
COUNT docdate2 TO mnRecCount WHERE BETWEEN(docdate2, CTOD("01/01/2000"), CTOD("02/15/2008"))

You should spend some time with the VFP Help window learning about the command & functions:
COUNT
CTOD()
BETWEEN()

You can also consider using a SQL Query to get your count of records.
SELECT COUNT(docdate2) FROM MyTable WHERE BETWEEN(docdate2, CTOD("01/01/2000"), CTOD("02/15/2008")) INTO CURSOR RecCnt

Good Luck
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On