rushitshah
Registered User.
- Local time
- Today, 00:02
- Joined
- Jul 27, 2005
- Messages
- 19
Hello Ppl..
I want help regarding generating different SQL statements.....for the following kind of table......
Product|Parameter|ItmDes|jan'05|feb'05|05Q1|05Y|jan'06|06Q2|06Y.......
_______________________________________________________________
So what I want to do is to run queries to find out monthly, quarterly and yearly data separately.....
1) jan'05, feb'05, ..... jan'06, feb'06......are monthly data...
so what I want is (logically)
when month is selected on the form for the output data,
ssql = "Select s.*jan* AND s.*Feb* AND s.*Mar*...........& _
"INTO [MONTH]" & _
"FROM [" & Me.PCYcle & "] s "
but SQL does not support this kind of * statements. I am sure that month field will include Jan, Feb, Mar, that kind of string , but it can be for year 05, 06, 07....so not sure about the year part.
2) 05'Q1, 05'Q2, ..... 06'Q3, 06'Q4......are quarterly data...
so in this case,
when quarter is selected on the form for the output data,
ssql = "Select s.*Q*" & _
"INTO [QUARTER]" & _
"FROM [" & Me.PCYcle & "] s "
but SQL does not support this kind of * statements. I am sure that month field will include Q1, Q2, Q3, Q4 that kind of string , but it can be for year 05, 06, 07....so not sure about the year part.
3) 05'Y, 06'Y, 07'Y......are yearly data...
so in this case,
when year is selected on the form for the output data,
ssql = "Select s.*Y*" & _
"INTO [Year]" & _
"FROM [" & Me.PCYcle & "] s "
but SQL does not support this kind of * statements. I am sure that month field will include Y in all year data column, but it can be for year 05, 06, 07....so not sure about the year part.
Please help building up this kind of logic and SQL statements... I am not sure about the year part in columns, it can be anything....so can not specifically define columns like,
select s.05'Q1, s.06'Q2, s.07'Q3........
Because I am developing this application for all kind of input tables and they may have different year range, so need some kind of dynamic way to generate this.
Thanks in advance....
I want help regarding generating different SQL statements.....for the following kind of table......
Product|Parameter|ItmDes|jan'05|feb'05|05Q1|05Y|jan'06|06Q2|06Y.......
_______________________________________________________________
So what I want to do is to run queries to find out monthly, quarterly and yearly data separately.....
1) jan'05, feb'05, ..... jan'06, feb'06......are monthly data...
so what I want is (logically)
when month is selected on the form for the output data,
ssql = "Select s.*jan* AND s.*Feb* AND s.*Mar*...........& _
"INTO [MONTH]" & _
"FROM [" & Me.PCYcle & "] s "
but SQL does not support this kind of * statements. I am sure that month field will include Jan, Feb, Mar, that kind of string , but it can be for year 05, 06, 07....so not sure about the year part.
2) 05'Q1, 05'Q2, ..... 06'Q3, 06'Q4......are quarterly data...
so in this case,
when quarter is selected on the form for the output data,
ssql = "Select s.*Q*" & _
"INTO [QUARTER]" & _
"FROM [" & Me.PCYcle & "] s "
but SQL does not support this kind of * statements. I am sure that month field will include Q1, Q2, Q3, Q4 that kind of string , but it can be for year 05, 06, 07....so not sure about the year part.
3) 05'Y, 06'Y, 07'Y......are yearly data...
so in this case,
when year is selected on the form for the output data,
ssql = "Select s.*Y*" & _
"INTO [Year]" & _
"FROM [" & Me.PCYcle & "] s "
but SQL does not support this kind of * statements. I am sure that month field will include Y in all year data column, but it can be for year 05, 06, 07....so not sure about the year part.
Please help building up this kind of logic and SQL statements... I am not sure about the year part in columns, it can be anything....so can not specifically define columns like,
select s.05'Q1, s.06'Q2, s.07'Q3........
Because I am developing this application for all kind of input tables and they may have different year range, so need some kind of dynamic way to generate this.
Thanks in advance....