|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How do I use If-Else statements in VB-Firebird?
Example: SELECT tr_dir, tr_time FROM transaction; I want... IF (tr_dir=1) min(tr_time) is returned else if (tr_dir=0) max(tr_time) is returned. |
|
#2
|
||||
|
||||
|
Yours looks like a more complex query, post some sample data and expected results and choose if you want this done at database level or at application level.
__________________
My blog about OpenSource Databases PDF tutorials about OSS databases, DBMonster ... Please contribute to Open Source Development, fill bug reports!!! Developer Shed eSupport Commented my.ini/my.cnf (PLEASE ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins |
|
#3
|
|||
|
|||
|
Quote:
database level |
|
#4
|
|||
|
|||
|
Quote:
try this dim x as long (double, etc) "SELECT IIF(tr_dir=1,MIN(tr_time),MAX(tr_time)) _Value FROM transaction WHERE tr_dir= " & x if x as string dim x as string "SELECT IIF(tr_dir=1,MIN(tr_time),MAX(tr_time)) _Value FROM transaction WHERE tr_dir= ' " & x & " ' " Best regards, Tom |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > VB - Firebird If-Else |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|