robjones23
Registered User.
- Local time
- Today, 10:21
- Joined
- Dec 16, 2004
- Messages
- 66
Hi,
I'm not sure if I'm going about this right but I'll give it a go
I have a Database with a lot of tables and queries. Queries run on Table A and make a new Table "Table X". Another query runs on Table B and creates "Table Y". A third Query then compares Table X and Table Y's "Minute" Field. From here, All the records in Table X are copied to a new table "Table Z" and the matches from Table Y are added onto the columns in "Table Z"
What this creates is a table with, lets say for example 1000 records and approx 60 or so have blank sections (i.e. where there is no match from Table Y).
What I now want is to run something (I'm not sure if a Query is the right way to go about this) on the resulting table which fills in the blanks with whatever is in the previous record.
E.g.
Table X Table Y
HasData Hasdata
HasData NoData
HasData NoData
HasData HasData
So what I want to happen is when it finds a null vlaue, it copies in the previous records value. So in the Above the Data would have "HasData" in all records.
I'm thinking something like:
If Is Null then ?????
Else
???????
but I don't know SQL well enough to understand what I need, only that I know it should be possible.
I hope!!!
Thanks in advance for any help possible!
Rob.
I'm not sure if I'm going about this right but I'll give it a go
I have a Database with a lot of tables and queries. Queries run on Table A and make a new Table "Table X". Another query runs on Table B and creates "Table Y". A third Query then compares Table X and Table Y's "Minute" Field. From here, All the records in Table X are copied to a new table "Table Z" and the matches from Table Y are added onto the columns in "Table Z"
What this creates is a table with, lets say for example 1000 records and approx 60 or so have blank sections (i.e. where there is no match from Table Y).
What I now want is to run something (I'm not sure if a Query is the right way to go about this) on the resulting table which fills in the blanks with whatever is in the previous record.
E.g.
Table X Table Y
HasData Hasdata
HasData NoData
HasData NoData
HasData HasData
So what I want to happen is when it finds a null vlaue, it copies in the previous records value. So in the Above the Data would have "HasData" in all records.
I'm thinking something like:
If Is Null then ?????
Else
???????
but I don't know SQL well enough to understand what I need, only that I know it should be possible.
I hope!!!
Thanks in advance for any help possible!
Rob.