Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conversion issue

Status
Not open for further replies.

SqlHunter

Programmer
Jun 3, 2004
166
US
here I want to insert .0000 value (advance_pay-column (type -money) in tbl_ad_book) to the database and it gives me an error saying I need to convert it into datatype

This is not working convert(.0000 as money)
 
SqlHunter,

The two conversion syntax's are:

CAST(value AS datatype)

CONVERT(datatype, value)

One exception to CONVERT. If you are converting from a DATETIME datatype to a string (VARCHAR, CHAR, etc), then it's:

CONVERT(datatype, value, style)

Refer to the BOL, use the Index tab, enter CONVERT.

-SQLBill

BOL=Books OnLine=Microsoft SQL Server's HELP
Installed as part of the Client Tools
Found at Start>Programs>Microsoft SQL Server>Books OnLine

Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top