Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's Wrong With This Syntax?
Message
From
04/01/2006 12:17:23
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01082695
Message ID:
01083196
Views:
16
>Ok, here's the full query. It took 6 minutes 11 seconds to run. Obviouslty this
>is far too slow. I'm open to suggestion:
>
>
>SELECT CAST(0 AS bit) AS checked,
>       '                    ' AS invoiceid,
>       '                    ' AS ISCI,
>       '  ' AS dayofweek,
>       '          ' AS Phone,
>       doc.id AS docid,
>       doc.station,
>       doc.client,
>       mo.show_title,
>       mo.order_rate AS gross,
>       mo.program_name,
>       mo.order_qty AS ordqty,
>       mo.id AS line_id,
>       mod.actual_air_date,
>       mod.actual_air_time
>  FROM Document doc
>  JOIN Client cl ON cl.id = doc.client
>  JOIN Station st ON st.id = doc.station
>  JOIN Media_Order mo ON mo.Document = doc.id
>  JOIN Show_title sht ON sht.id = mo.show_title
>  JOIN Media_Order_Detail mod ON mod.Media_Order = mo.id
>  WHERE st.id = 733 AND
>        actual_air_date between '2005-07-01 00:00:00.000' and '2005-07-31 00:00:00.000
>
>  ** The WHERE clause would normally be built on the fly.
>
>'
>
>
>
>
>
>
>
>
>
>
>
>>You're welcome.
>>
>>>All works fine now. Thanks!
>>>
>>>
>>>
>>>>There're no boolean type in T-SQL. The closest one is bit.
>>>>SELECT CAST(0 AS bit) AS checked,
>>>>...
>>>>
>>>>>Ok, now it doesn't like the 'FALSE'. Whats the correct way to
>>>>>create a boolean column?

- paste it into QA
- F5
- CTRL+I
Previous
Reply
Map
View

Click here to load this message in the networking platform