Board index » delphi » SQL-Typecasting to boolean ?
Ralf Steinhaeusser
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
Ralf Steinhaeusser
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
SQL-Typecasting to boolean ?
I'd like to create a table like
SELECT Name, Amount, TooHeavy And TooHeavy shold be a boolean value It doen't work with Can this be achieved in another way ? Any Ideas, Thanks, |
Martijn Tonie
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:SQL-Typecasting to boolean ?Hi there, you could try a calculated field in the TQuery or TTable component. Right <- remove some characters from my email adress to reply -> Ralf Steinhaeusser heeft geschreven in bericht Quote>I'd like to create a table like |
Glatzfam
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:SQL-Typecasting to boolean ?Quote>SELECT Name, Amount, TooHeavy inside of SQL? What DB are you using? Delphi isn't the one that doesn't like the Select statement, it's the DB you are using that doesn't like it. What you could try (if I'm understanding what you are trying to do) is Select Name, Amount, 'True' As TooHeavy HTH ******************************** |
Ralf Steinhaeusse
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:SQL-Typecasting to boolean ?btw : I just want to show whether a triggervalue is exceeded or not - just an extra info - in a dbgrid And I'm using Paradox-tables that's all for now... |
Steve Koters
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:SQL-Typecasting to boolean ?On Mon, 26 Apr 1999 15:13:04 +0200, Ralf Steinhaeusser Quote<r...@sbox.tu-graz.ac.at> wrote: SQL-92 specification. However, since you are using Paradox tables, local SQL rules apply. Local SQL -- while a subset of SQL-92 -- simply does not include this construct in that subset. You can do what you ask in local SQL through other means, though. One way you can do this in local SQL is with a UNION join concatenating two SELECT Name, Amount, TRUE AS TooHeavy ////////////////////////////////////////////////////////////////////////// |
Steve Koters
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:SQL-Typecasting to boolean ?On Mon, 26 Apr 1999 16:27:06 GMT, skoter...@NOSPAMinprise.com (Steve QuoteKoterski) wrote: Looking at what I posted, believe the SQL was not quite what was needed. Quote> SELECT Name, Amount, TRUE AS TooHeavy should filter to rows where the Amount column is greater than zero *and* less than 100. Otherwise, the greater-than-100 rows would be in both SELECT result sets. SELECT Name, Amount, TRUE AS TooHeavy ////////////////////////////////////////////////////////////////////////// |
billy ch
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:SQL-Typecasting to boolean ?Mon, 26 Apr 1999 15:13:04 +0200 in comp.lang.pascal.delphi.databases, Ralf Steinhaeusser <r...@sbox.tu-graz.ac.at> Quote> I'd like to create a table like select Name,Amount,'T' as TooHeavy from xyz |