User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 427,939 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,827 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 477 | Replies: 2
Reply
Join Date: Sep 2007
Posts: 50
Reputation: kehar is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
kehar kehar is offline Offline
Junior Poster in Training

convert date value from dtpicker to string

  #1  
Jul 25th, 2008
Hi,
I would like to pass on a parameter from VB6 for the date.value from datepicker.
Pl help me how to convert date.value into string as the parameter I have created in
Crystal Report is string type. The parameter name in Crystal Report is chdate.

I wrote the code as under but it did not work

Dim a as string
Dim b as date
b=dt1.value
a=Cstr(b)

So pl help me.

(Kehar)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2008
Posts: 31
Reputation: Teropod is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
Teropod Teropod is offline Offline
Light Poster

Re: convert date value from dtpicker to string

  #2  
Jul 25th, 2008
Well since string can accept any characters except special ascii(0) who is end of string witch means after ascii(0) you wont be able to see any characters if you have some.

and if you write it these way it should work.

Dim d As Date
Dim a As String

    d = "1.1.2000"
    a = d

Have fun
Reply With Quote  
Join Date: Nov 2006
Posts: 712
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 97
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Master Poster

Re: convert date value from dtpicker to string

  #3  
Jul 25th, 2008
Hi,

Try This :

  1. Dim a as string
  2. a = Format(dt1.value,"dd-mm-yyyy")

Regards
Veena
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 6:33 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC