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)

Recommended Answers

All 2 Replies

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

Hi,

Try This :

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

Regards
Veena

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.