| Author |
Topic |
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2009-06-16 : 09:39:58
|
| What is the equivalent for numbers ? In this ?skill will be a number and ANS_QId is a numeric field in a sql table. It is to be used in a crystal report selection formulainstr({?skill},{vweShowAnswers.ANS_QId}) > 0 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2009-06-16 : 10:14:03
|
| You can convert all data to character in the statement.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2009-06-16 : 10:24:07
|
| Could you help me witrh the syntax for that please. Is it something like this ?instr(char({?skill}),char({vweShowAnswers.ANS_QId})) > 0 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-16 : 12:26:52
|
| instr is not in sql. you need to use charindexCHARINDEX(CONVERT(char(1), skill),CONVERT(varchar(15),ANS_QId))>0 |
 |
|
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2009-06-17 : 08:02:39
|
| Thank you visakh I will try that now |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-17 : 08:08:31
|
WHERE CAST(ANS_QId AS VARCHAR(12)) LIKE '%' + @skill + '%' E 12°55'05.63"N 56°04'39.26" |
 |
|
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2009-06-17 : 09:19:18
|
| I was approaching it completely wrong. This is what I needed{vweShowAnswers.ANS_QId} = ToNumber ({?Skill}) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-17 : 10:01:47
|
quote: Originally posted by Pinto I was approaching it completely wrong. This is what I needed{vweShowAnswers.ANS_QId} = ToNumber ({?Skill})
werent you using SQL Server? |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-17 : 10:07:40
|
quote: Originally posted by Pinto It is to be used in a crystal report selection formula
E 12°55'05.63"N 56°04'39.26" |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-17 : 10:09:41
|
quote: Originally posted by Peso
quote: Originally posted by Pinto It is to be used in a crystal report selection formula
E 12°55'05.63"N 56°04'39.26"
ah..i've turned blind |
 |
|
|
|