Solved

Need help with SYBASE syntax

Posted on 2016-07-14
5
46 Views
Last Modified: 2016-08-01
I am wondering if there are any SYBASE sql coders who can spot any syntax errors at line 355. I am getting this error message,
and cannot spot what the problem is?

Incorrect syntax near '+'.

355  PRINT ' Client Endtered Data On ' + CONVERT(VARCHAR(10),CONVERT(TIME,GETDATE()))
0
Comment
Question by:brgdotnet
5 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 41711664
can you post codes from lines 354 to 356 ?

line 355 seems ok.
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 41711710
I know the same limitation in sql server:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc00801.1510/html/iqrefso/X315758.htm
Syntax
PRINT format-string [, arg-list]

Open in new window

so you need to do this:
PRINT ' Client Endtered Data On %1' , CONVERT(VARCHAR(10),CONVERT(TIME,GETDATE())) 

Open in new window

0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 41711711
0
 
LVL 2

Author Closing Comment

by:brgdotnet
ID: 41713777
Thank you Guy
0
 
LVL 3

Expert Comment

by:knel1234
ID: 41738054
Adding to Guy  Hengel's link above (for the print logic only) are you trying to do this
declare @var1 varchar(10), @var2 varchar(10)
select @var1 = convert(varchar(10),getdate(),108)
select @var2 = convert(varchar(10),getdate(),118)
PRINT ' Client Endtered Data On %1!', @var1
PRINT ' Client Endtered Data On %1!' , @var2
PRINT ' Client Endtered Data On %1! and also on %2! ', @var1, @var2

or am I way off base here?

cheers
knel
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

What is Backup? Backup software creates one or more copies of the data on your digital devices in case your original data is lost or damaged. Different backup solutions protect different kinds of data and different combinations of devices. For e…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now