Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get data from 2 tables
Message
From
08/02/2019 19:07:16
 
 
To
08/02/2019 11:52:58
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008 R2
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01666006
Message ID:
01666147
Views:
47
>>Sir you used your following codes
>>
>>
>>SELECT Date, DatePart(hour,Date) as Hr, reading
>>FROM bin1_empty A
>>WHERE EXISTS( 
>>(SELECT Min(Date) as date_B
>>FROM bin1_empty B
>>WHERE DatePart(hour,A.Date) = DatePart(hour,B.Date) 
>>HAVING B.Date_B = A.Date)
>>OR EXISTS(
>>SELECT Min(Date) as date_C
>>FROM bin1 C
>>WHERE DatePart(hour,A.Date) = DatePart(hour,C.Date)
>>HAVING C.Date_C = A.Date)
>>
>>
>>but it has error shown in image.
>
>
>I think there was one ) too much:
>
>
>SELECT Date, DatePart(hour,Date) as Hr, reading
>FROM bin1_empty A
>WHERE EXISTS( 
>SELECT Min(Date) as date_B
>FROM bin1_empty B
>WHERE DatePart(hour,A.Date) = DatePart(hour,B.Date) 
>HAVING B.Date_B = A.Date)
>OR EXISTS(
>SELECT Min(Date) as date_C
>FROM bin1 C
>WHERE DatePart(hour,A.Date) = DatePart(hour,C.Date)
>HAVING C.Date_C = A.Date)
>
Sir it has still error like shown in image.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform