SELECT *
FROM tbl_Datatable
WHERE (tbl_Datatable.strPRICE)='?40'; (the ? should be a euro symbol
Alt+0128. it appears that even just posting causes the same problem)
This query returns nothing although there are many entries with a strPRICE
of '?40'
SELECT *
FROM tbl_Datatable
WHERE (tbl_Datatable.strPRICE)='$40';
This query returns all with a strPRICE of '$40'
How do I use the symbol in queries?
Regards
Colin
"Col" <newslett...@hotmail.com> wrote in message
news:%23VS7V0i...@TK2MSFTNGP03.phx.gbl...
You mean you store the price as a string?! Why? I'd say that entering a euro
symbol will be the least of your problems.
--
David Portas
If you are using a passthrough query, try adding the prefix N before the
string constant:
SELECT *
FROM tbl_Datatable
WHERE (tbl_Datatable.strPRICE)=N'€40';
If this doesn't work, then replace the ANSI type of the field with an
Unicode type: instead of using the types char, varchar and text; use the
types nchar, nvarchar and ntext. Notice that even with these Unicode types,
you must still add the N prefix before all string constants for all your
passthrough queries (but not for you JET queries).
It's possible to have the euro symbol without using Unicode; however, it
will be a moving target.
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"Col" <newslett...@hotmail.com> wrote in message
news:%23VS7V0i...@TK2MSFTNGP03.phx.gbl...
1) Do not put prefixes to tell the compiler what the physical storage
structure is. We only have tables in SQL anyway!
2) Do not put prefixes to tell the compiler what the physical storage
data type is. BASIC had to use $ for strings because of a one-pass
interpreter in the old days; this is SQL.
3) you need a better data element name, such as "foobar_price" that
follows ISO-11179 rules.
4) Prices are numeric data, and require numeric data types. Look up
the rules for Euros (triangulation, required decimal places, etc.);
what you have is going to give illegal results.
5) Why are you formatting data in the back end? The basic principle
of a tiered architecture is that display is done in the front end and
never in the back end. This is a more basic programming principle
than just SQL and RDBMS.
The strPRICE field may contain many prices separated by commas. This is
defined in SQL Server as nvarchar(125)
I'm trying to run the query in an Access front end so the =N'?40' does not
work.
I'll look into the code page issue
Regards
Colin
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:uvNAPAkK...@TK2MSFTNGP05.phx.gbl...
> You have a code page translation problem because the code page on the
> server is not the same as the code page (either OEM or Window) used by
> your client.
>
> If you are using a passthrough query, try adding the prefix N before the
> string constant:
>
> SELECT *
> FROM tbl_Datatable
> WHERE (tbl_Datatable.strPRICE)=N'?40';
Create a passthrough query and verify that the unicode value for the euro
character is 8364 and not something else:
SELECT unicode (left (NameOfYourField, 1)) from NameOfYourTable.
What ODBC driver are you using and what kind of collation have been defined
for the database/table/column? Also, is the "Perform Translation for
character data" correctly checked in the DSN options?
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"Col" <newslett...@hotmail.com> wrote in message
news:e%23NH82wK...@TK2MSFTNGP06.phx.gbl...
The query returns the correct character. MSAccess shows the correct
character in table view, but when used in a query, converts it to a '?'
SELECT unicode (left (strPRICE, 1)), left (strPRICE, 1) from tbl_Datatable
8364 ?
8364 ?
8364 ?
8364 ?
Regards
Colin
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:epTmCC1K...@TK2MSFTNGP04.phx.gbl...
Maybe the current font used in Access on your machine for displaying the
result of this query is not capable of displaying the euro symbol. How are
you using this query exactly and what version of Access and Windows are you
using?
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"Col" <newslett...@hotmail.com> wrote in message
news:u4SV$lVLIH...@TK2MSFTNGP06.phx.gbl...
I'm trying to get a recordset from the query built with VB
If Left(strPRODCOST, 3) = "US$" Then
strCUR = "US$"
~....~
ElseIf Left(strPRODCOST, 1) = "?" Then
strCUR = "?"
Else
strCUR = "£"
End If
strSQL = "SELECT tbl_Datatable.strPRICE"
strSQL = strSQL & " FROM tbl_Datatable"
strSQL = strSQL & " WHERE LEFT(tbl_Datatable.strPRICE," & Len(strCUR) &
") = '" & strCUR & "'"
Set ds = DB.OpenRecordset(strSQL, dbOpenDynaset)
If Not (ds.BOF And ds.EOF) Then
ds.MoveFirst
etc...
The recordset works fine for other currency symbols but is always empty for
Euro.
I am using MSAccess XP on Windows XP and SQL Server 2005
Regards
Colin
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:%23ZIkPGa...@TK2MSFTNGP05.phx.gbl...
Dim db As Database
Set db = CurrentDb
Dim strsql
strsql = "SELECT tbl_Datatable.strPRICE from tbl_Datatable"
Dim ds As DAO.Recordset
Set ds = db.OpenRecordset(strsql, dbOpenDynaset, dbSeeChanges)
While Not ds.EOF
MsgBox ds("strPRICE ") & ": " & AscW(Left(ds("strPRICE "), 1))
ds.MoveNext
Wend
Repeat with:
strsql = "SELECT tbl_Datatable.strPRICE from tbl_Datatable where left
(s, 1) = '€'"
(Put the Euro symbol here between the two single quotes ' )
And:
strsql = "SELECT tbl_Datatable.strPRICE from tbl_Datatable where left
(s, 1) = '" & ChrW(8364) & "'"
Like with the passthrough query, AscW should give 8364. Finally, I don't
understand that you didn't need the option dbSeeChanges on a linked
SQL-Server table with a primary key. Is there a primary key on this table?
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"Col" <newslett...@hotmail.com> wrote in message
news:ejF9mE9L...@TK2MSFTNGP03.phx.gbl...
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:%23HV%23Ju%23LIH...@TK2MSFTNGP03.phx.gbl...