sorry,
dim v_total_day as integer
dim v_star_date as date
dim v_end_date as date
v_start_day = Format('11/04/2007', "\#mm\/dd\/yyyy\#")
v_end_date = Format('01/07/2007', "\#mm\/dd\/yyyy\#")
v_total_day = v_end_date - v_start_day
The Format() function returns a text string, not a date nor a number.
I'm GUESSING that Access will see 11/04/2007 as an arithmatic expression - 11
divided by 4 divided by 2007 - when it's used in a subtraction, and the same
for 01/07/2007.
To get the number of days between two dates, use the DateDiff() function:
DateDiff("d", #11/04/2007#, #01/07/2007#)
Note that dates ARE NOT TEXT STRINGS, and ' is not an appropriate delimiter;
use # to delimit literal date values (and be aware that date literals are
assumed to be in American mm/dd/yyyy format).
John W. Vinson [MVP]