RAN
Posts: 28
|
| Posted: 05/16/2005, 8:02 AM |
|
Hi
I have a column Model_Number. In this column I have 5 items model number 1, and 3 items model number 2.
On load, I want show only One model_number (1) and One model_number (2)
I already try everething but Onload show me always (total) 8 items instead of 2.
I think in input parameters of CC I should select only one input of ONE item but how? I have to use a script?
I use CC Asp and MSAccess
Sorry my english
Thank you in advance
|
 |
 |
Oper
Posts: 1195
|
| Posted: 05/16/2005, 8:33 PM |
|
Hi Ran
Could you explain more?
if you mean:
* you has just 1 Column
* you have 5 records:
Model1
Model1
Model1
Model1
Model1
Model2
Model2
Model2
And you only one to show
Model1
Model2
Then you only need to create a Group by Model
or more Easy create a Query on Access that do this and only read that query.
(let me know if that was what you were trying to explain)
http://www.GlobalDevelop.com
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
RAN
Posts: 28
|
| Posted: 05/17/2005, 1:10 AM |
|
Thank you for your help. Yes is it...
* I have just 1 Column
* I have 5 records or more.
Model1
Model1
Model1
Model1
Model1
Model2
Model2
Model2
Model3
Model3
Model4....
And you only one to show
Model1
Model2
Model3
Model4
Can you tell me please how to group by model or create a Query on Access? I use code charge not code charge studio and MSAccess
Thank you
|
 |
 |
Nicole
Posts: 586
|
| Posted: 05/17/2005, 1:52 AM |
|
Ran,
You can build SQL query directly in CCS and it would look like
Select model_column_name from table_name group by column_name
Or create such query in Access and save it as Query object, then in CCS select it for form Data Source (in the same way as you select a Table).
Of course it is not cut’n’paste query, you need to adapt it.
_________________
Regards,
Nicole |
 |
 |
RAN
Posts: 28
|
| Posted: 05/17/2005, 2:12 AM |
|
Quote Nicole:
Ran,
You can build SQL query directly in CCS and it would look like
Select model_column_name from table_name group by column_name
Or create such query in Access and save it as Query object, then in CCS select it for form Data Source (in the same way as you select a Table).
Of course it is not cut’n’paste query, you need to adapt it.
Dear Nicole
Thank you for your help but I use CodeCharge not CCS.
I already put this code (Select model_column_name from table_name group by column_name) in Form Properties - SQL in CodeCharge and didnt work
|
 |
 |
RAN
Posts: 28
|
| Posted: 05/17/2005, 2:27 AM |
|
I already try (SELECT First(product.model_id) AS whatever FROM product GROUP BY Left(model_id,1);
This script work, group the models, but dont show image or records
only a empty spaces.
Because when i use in Form Properties - SQL, the other commands (Form Properties - input...) dosent work anymore.
|
 |
 |
Nicole
Posts: 586
|
| Posted: 05/17/2005, 2:46 AM |
|
Well, in general in CC you can also use Custom SQL for listbox data source, but it must have the following structure
Select field1, field2 from ...
I.e. 2 fields should be included into SELECT. So you can try query like
Select model_field_name, model_field_name from table_name ...
BTW, why did you post CC issue to CCS forum?
_________________
Regards,
Nicole |
 |
 |
RAN
Posts: 28
|
| Posted: 05/17/2005, 2:52 AM |
|
Dear Nicole,
If you dont mind you can see on http://www.umbicap.com/umbicap/default.asp
When I click in "Bonés" left menu i go to another webpage (default_produtos.asp). In this webpage I only have to see one model of cap. But in this case I see 3 same model
|
 |
 |
RAN
Posts: 28
|
| Posted: 05/17/2005, 2:54 AM |
|
"BTW, why did you post CC issue to CCS forum?"
Sorry my mistake
|
 |
 |
Nicole
Posts: 586
|
| Posted: 05/17/2005, 6:07 AM |
|
Ran,
I visited your page and I see that in fact 4 different records are shown in grid (Imagem and Modelo columns), these records have different ID value. It is impossible to group data on Modelo_ID if unique ID is in SELECT statement.
Exclude ID (and other unique fields) from SELECT and add Group By.
_________________
Regards,
Nicole |
 |
 |
RAN
Posts: 28
|
| Posted: 05/17/2005, 6:52 AM |
|
Dear Nicole,
Thank you by your time but...
The 3 first records have (1) value and the last (2) value.
I already try everithing (I think) in SQL and dosent work.
Can I use a script in before show event instead of SQL?
I go use this SQL can you see how it work?
SELECT First(produtos.modelo_id) AS whatever FROM produtos GROUP BY Left(modelo_id,1);
Please click on Bonés menu. http://www.umbicap.com/umbicap/default.asp
Thank one more time
|
 |
 |
RAN
Posts: 28
|
| Posted: 05/17/2005, 4:10 PM |
|
I dont know how much can I do
Another option is maybe hide equals records in column (modelo_id), table (produtos) but how? Like a filter?
|
 |
 |
Oper
Posts: 1195
|
| Posted: 05/21/2005, 4:34 PM |
|
RAN use the Build QUERY on ACCESS is super easy to use.
I wil try to make a Small Video on how to do that.
But shirnk the Access DB and send to me so i coudl show you how, work fo CC and CCS.
Let me know......
http://www.GlobalDevelop.com
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |