[OT] sql convert datetime problem; forcing order of AND statements

2012-10-29 Thread Wallace Turner
I'm running into an issue with a select query; it appears the CONVERT operator is performed before any other condition in the WHERE clause. Consider the data below: Now some queries, This one works, note only 6 rows are returned: SELECT

Re: [OT] sql convert datetime problem; forcing order of AND statements

2012-10-29 Thread Emily Waghorne
Hi Wal, I'm not sure it's a case of one being executed first, because I assume the where clause has to be executed in its entirety before the engine decides if it matches or not. You are thinking like the operator in c# which only executes the second half of the comparison if the first half

Re: [OT] sql convert datetime problem; forcing order of AND statements

2012-10-29 Thread Les Hughes
Wallace Turner wrote: I'm running into an issue with a select query; it appears the CONVERT operator is performed before any other condition in the WHERE clause. Consider the data below: Now some queries, This one works, note only 6 rows are returned: |SELECT Value,CONVERT(DATETIME,

Re: [OT] sql convert datetime problem; forcing order of AND statements

2012-10-29 Thread Davy Jones
Hi SQL always executes right to left, all parts of your query are executed but the filter is only applied on your results. However, the sqlserver optimiser can and will rearrange your query for you so even checking to see if it is a date first ( to the right ) is not guaranteed to work. So you

Re: [OT] sql convert datetime problem; forcing order of AND statements

2012-10-29 Thread Les Hughes
Davy Jones wrote: Hi SQL always executes right to left Are you talking about boolean evauluation? If so... False. (At least for 2008 R2 which I have in front of me) -- Les Hughes l...@datarev.com.au

Re: [OT] sql convert datetime problem; forcing order of AND statements

2012-10-29 Thread Davy Jones
As far as I am aware, and coming from a time when we didn't have optimisers. All parts are evaluated A part, in the case of a case else is is the statement as a whole. Select * from t where Id = 3 and date 1997 Without the optimiser, It does Date 1997 Id = 3 Select * With the optimiser it

RE: [OT] sql convert datetime problem; forcing order of AND statements

2012-10-29 Thread Williams, Thomas
As an alternative to CTE/subselect, you could do something like below. Not sure of the implications on indexing: --temp table DECLARE @temp TABLE ( [Value] VARCHAR(15) ) --populate INSERT INTO @temp SELECT '28-Nov-2012' UNION ALL SELECT '28-Nov-2012' UNION ALL SELECT 'blah' SELECT

Re: [OT] sql convert datetime problem; forcing order of AND statements

2012-10-29 Thread Wallace Turner
Hi, I wasn't getting these responses at first so apologies for the delay in responding. In between then and now I ended up going with the CASE solution (same as Les and Thomas, thank you) I'm going to stick with it but I'm not a huge fan of that as its clearly then doing unnecessary work by

Creating Manuals/User Guides

2012-10-29 Thread Corneliu I. Tusnea
Hi, Anyone has a good way of creating manuals/training/user guides? I've found HTML/Word very cumbersome and more or less useless so I'd like something better. There is also a service (www.dozuki.com) that is the basis of iFixIt website that looks great and they use an open source format called

Re: Creating Manuals/User Guides

2012-10-29 Thread Michael Minutillo
I haven't tried it yet but we use a suite of tools for acceptance testing that are capable of automating the user interface and taking screenshots of various windows when test steps go wrong. I want to write a collection of Documentation Tests that when run produce a report that shows key

Re: Creating Manuals/User Guides

2012-10-29 Thread Glen Harvy
DrExplain On 30/10/2012 12:41 PM, Corneliu I. Tusnea wrote: Hi, Anyone has a good way of creating manuals/training/user guides? I've found HTML/Word very cumbersome and more or less useless so I'd