Helo everybody

How to convert database type from datetime to varchar? and decimal to varchar?
Can I use this code?

CAST(now() as varchar(20))

I use MySQL version 5.0.21


Other question:
If I execute procedure

CREATE PROCEDURE `formatdate`(dtDate datetime)
BEGIN
SELECT date_format(now(),'%d-%m-%Y') AS idate;
END $$

in Visual Basic 6 using ADODB and get "idate" field
the application will retur error "Multiple step operation generated errors. Check each status value"

Why this happend?
There is any solution if i want to get datetime value has formated as string value to VB6 application?

Thanks for help Question

Hi,

In Procedure, you Have not defined the OUT parameter..

Try this procedure:

CREATE PROCEDURE FormatDate(OUT IDate Char(20))
BEGIN
SELECT date_format(now(),'%d-%m-%Y') INTO IDate ;
END;


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.