How to count the no of days?

german

Registered User.
Local time
Yesterday, 21:30
Joined
Jul 5, 2012
Messages
21
How to calculate the number of days from the selected date to current system date?
Can some one help me to find solution for this?

i am new to the development area.I dont have enough knowledge.
i have attached the database .help me to calculate the amount based on the days
 

Attachments

Last edited:
You could use the DateDiff() function, which might look something like;
Code:
=DateDiff("d", [YourDateField], [URL="http://www.techonthenet.com/access/functions/date/date.php"]Date()[/URL])
 
thank u john .I have done that,

But i have to calculate some charges based the days


Ex:If the day >11 then the charges should be qty*2 and if day>30 then the charges should be qty*4


I dont get any idea out .


can u please check the db and help me to create a new bill and stock


I need this favor from .please help me


Thank you
 
You'd need something along the lines of;

Code:
If DateDiff("d", [YourDateField], Date()) > 11 And DateDiff("d", [YourDateField], Date()) <= 30 Then
     [COLOR="Green"]'Insert code for Qty *2[/COLOR]
Else If DateDiff("d", [YourDateField], Date()) > 30 Then
     [COLOR="Green"]'Insert code for Qty *4[/COLOR]
Else
     [COLOR="Green"]'Insert code for Qty[/COLOR]
End If
 
For info
Logically if doing the tests in a block If or a Select Case if you do the tests in the correct order then the or tests will not normally be needed

Eg
If >30
ElseIf >11
Else

Brian
 
Thank you so much for your valuable help.


I have done it .
 

Users who are viewing this thread

Back
Top Bottom