Hi, i am still stuck in SQL query about how to retrieve data from two tables.
I have two database tables- Forecast
-------------------------------------------------------------------
TimeStamp | Temperature | Rainfall | Wind | City_Code
---------------------|-------------|---------|-------|-------------
2011-03-13 10:00:00 |22.2 (degC) | 0 | 7 | 1
2011-03-13 11:00:00 |23.1 (degC) | 0 | 6 | 1
-------------------------------------------------------------------
and Tower
-------------------------------------------------------------------
TimeStamp | Temperature | Rainfall | Wind | Tower_name
---------------------|-------------|---------|-------|-------------
2011-03-13 10:00:00 |19.5 (degC) | 0 | 7 | NAP
2011-03-13 11:00:00 |18.9 (degC) | 0 | 6 | NAP
-------------------------------------------------------------------
Now i need to retrieve the data from the two tables. How to do it? i need to display according to current TimeStamp. I know the sql query how to retrieve whole data according to current date and time from one table---
SELECT * from tower
WHERE TimeStamp >= DATEADD(DD,datediff(DD,0,getdate()),0)
AND TimeStamp < DATEADD(dd, datediff(dd, 0,getdate()) + 1,0)
But i could not able to apply for the two tables. Please give me some suggestion. Thanks in advance.