Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 31st, 2007, 08:44 AM
Registered User
 
Join Date: Aug 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kostaskir Send a message via Yahoo to kostaskir
Default Get Previous Date in vb.net

Hi,

I am a newbie to vb.net.

I am trying to get the previous date of Today() but I am facing difficulties.

I started like this...

  Dim DayOfYearConv as Integer
  DayOfYearConv = Today.Date.DayOfYear - 1
  TextBox1.text = DayOfYearConv


DayOfYearConv is giving me a number. Now I want to replace this number with the actual date. The previous date .

I would be greatful If you can help me...

Thanx.
 
Old August 31st, 2007, 09:21 AM
Authorized User
 
Join Date: May 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can use something like this :

Dim dteDate As Date

dteDate = Today.Date

dteDate = dteDate.AddDays(-1)








Similar Threads
Thread Thread Starter Forum Replies Last Post
VB.Net - Access DB - Date compare johneecc VB How-To 4 August 7th, 2008 04:23 PM
Needs to get previous date from the given date balakrishna Java Basics 1 April 23rd, 2007 05:25 AM
selecting date and previous dates harpua MySQL 0 April 5th, 2007 08:25 PM
How to get previous date? rupen Javascript How-To 1 June 26th, 2006 10:57 PM
Need to bring VB.NET Beta 1 code up to date! BAMaceK VB.NET 0 December 4th, 2003 09:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.