[AccessD] SQL Equivalent

kens.programming kens.programming at verizon.net
Tue Mar 3 09:56:33 CST 2009


John,

How about:

CASE WHEN [FieldA] = [FieldB] THEN 1 ELSE 0 END

Ken Stoker
Business Analyst

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Tuesday, March 03, 2009 7:49 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] SQL Equivalent

In Access you can create a query, even in the QBW, where you make a field
[FieldA]=[FieldB] as 
AIsEqB and the result is a true / false in a separate AIsEqB field.

I have been trying to do that in SQL Server and it just will not accept the
additional field.  More 
precisely, it tries to turn the [FieldA]=[FieldB] into a string
'[FieldA]=[FieldB]'.

If I manually edit the SQL to include a where clause looking like that it
turns it into an inner join.

Is there a way to create this construct (a new field that evaluates to a
true / false) in SQL Server?

-- 
John W. Colby
www.ColbyConsulting.com
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list