Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SPT Syntax
Message
From
26/05/2011 12:31:03
 
 
To
26/05/2011 12:18:57
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01511825
Message ID:
01511876
Views:
34
>That is a good question. This is a set of tasks to be done as a project. The owner could ask for an extension. So I need to find the task with latest date an change that date to extended date. So I guess in the case of duplicates it would be okay to chane all of them to new date.


You must translate this to DB2 syntax :-)
TEXT TO testconnString  NOSHOW

DECLARE @MaxDate datetime -- this is local variable declaration

Select @MaxDate = MAX(iDate) As iDate 
From (Select MAX(idate) As iDate From webprddt7.qms8dprevn Where edindex = 870871 And editeratn = 2
      Union All
      Select MAX(idate) As iDate From webprddt7.qms8dcntrl Where edindex = 870871 And editeratn = 2
      Union All
      Select MAX(idate) As iDate From webprddt7.qms8dvers1 Where edindex = 870871 And editeratn = 2
      Union All 
      Select MAX(idate) As iDate From webprddt7.qms8dpca   Where edindex = 870871 And editeratn = 2
      Union All
      Select MAX(idate) As iDate From webprddt7.qms8dica   Where edindex = 870871 And editeratn = 2) td


Select 'qms8dprevn' AS TableName, * From webprddt7.qms8dprevn Where edindex = 870871 And editeratn = 2 AND iDate = @MaxDate
Union All
Select 'qms8dcntrl' AS TableName, * From webprddt7.qms8dcntrl Where edindex = 870871 And editeratn = 2 AND iDate = @MaxDate
Union All
Select 'qms8dvers1' AS TableName, * From webprddt7.qms8dvers1 Where edindex = 870871 And editeratn = 2 AND iDate = @MaxDate
Union All 
Select 'qms8dpca'   AS TableName, * From webprddt7.qms8dpca   Where edindex = 870871 And editeratn = 2 AND iDate = @MaxDate
Union All
Select 'qms8dica'   AS TableName, * From webprddt7.qms8dica   Where edindex = 870871 And editeratn = 2 AND iDate = @MaxDate
ENDTEXT 
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform