Can you add two columns together and then alias the result?

56 views
Skip to first unread message

Dan Maharry

unread,
Jun 26, 2012, 6:33:22 AM6/26/12
to simpl...@googlegroups.com
Hi,

I'm trying to create a query that results in two columns being added together and aliased.

SELECT 
   VacationHours + SickLeaveHours AS 'Total Hours Away'
FROM HumanResources.Employee


Select((db.HumanResources.Employee.VacationHours + db.HumanResources.Employee.SickLeaveHours).As("TotalHoursAway"));
throws a MathReferenceException. 

Is it possible to do this?

Thanks, Dan

Mark

unread,
Jul 3, 2012, 7:05:35 PM7/3/12
to simpl...@googlegroups.com
No, but I'll get onto it.

Scott Chappel

unread,
Sep 13, 2012, 1:27:51 AM9/13/12
to simpl...@googlegroups.com
I think that this would be a nice feature also, even better would be to use the computed column as part of a join (which I have been trying to figure out if possible for the past hour or so). :)

Tim Straub

unread,
May 20, 2013, 2:49:35 PM5/20/13
to simpl...@googlegroups.com
Was this feature ever added and is it possible to concatenate and then alias text columns like......

(db.User.FirstName + " " + db.User.LastName).As("DisplayName")

Using v0.18.3.1 and getting a math.reference error b/c of the + signs.


Thanks,
-Tim

Mark Rendle

unread,
May 20, 2013, 6:35:32 PM5/20/13
to Simple.Data
I think it was added for numerics but possibly not for strings. Although I might be wrong.

Mark Rendle
Founder & CEO
Oort Corporation
Makers of Zudio


--
You received this message because you are subscribed to the Google Groups "Simple.Data" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simpledata+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages