[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 127
  • Last Modified:

Previouse Date

Hi all. I need to retrieve records one day earlier then today. So if today is 1/11/1999  i need to retrive from 1/10/1999.How do i calculate the date like this ?Thank you. Help is appreciated.
Thanks.
0
Marine
Asked:
Marine
1 Solution
 
deightonCommented:
Dim yDate As Date

yDate = DateAdd("d", -1, Date)
0
 
tureCommented:
Simply subtract 1 from the date.

Dim d As Date
d = Date
MsgBox d
d = d -1
MsgBox d

Ture Magnysson
Karlstad, Sweden
0
 
adityauCommented:
You can even use ydate = (Date - 1)
0
 
MarineAuthor Commented:
thanks, i just foudn that dateadd function.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now