all groups > sql server data mining > november 2005 >
I am trying to follow the example in sql server data mining book by Jamie and Tang. On page 95, step 3 for creating name calculation on customers table, I enter the following expression: CASE WHEN [NUM BEDROOMS] = 1 THEN 'ONE' WHEN [NUM BEDROOMS] <= 1 THEN 'TWO OR THREE' WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE' ELSE 'NONE' END When I click okay, I get the following error: IErrorInfo.GetDescription failed with E_FAIL(0x80004005). Has this worked for anyone else here or I am missing some thing??
I haven't tried the example, but I can see a logical error in the code. Check the 2nd condition - you can't get two or three bedrooms for any case. -- Dejan Sarka, SQL Server MVP Mentor www.SolidQualityLearning.com [quoted text, click to view] "sqlster" <nospam@nospam.com> wrote in message news:BCC4A099-ECF4-4007-850D-3E3CC6E1A698@microsoft.com... >I am trying to follow the example in sql server data mining book by Jamie >and > Tang. > > On page 95, step 3 for creating name calculation on customers table, I > enter > the following expression: > > CASE > WHEN [NUM BEDROOMS] = 1 THEN 'ONE' > WHEN [NUM BEDROOMS] <= 1 THEN 'TWO OR THREE' > WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE' > ELSE 'NONE' > END > > When I click okay, I get the following error: > > IErrorInfo.GetDescription failed with E_FAIL(0x80004005). > > Has this worked for anyone else here or I am missing some thing?? > > TIA...
The third line of the sample is WHEN [NUM BEDROOMS] <= 3 THEN 'TWO OR THREE' -- -Jamie MacLennan SQL Server Data Mining This posting is provided "AS IS" with no warranties, and confers no rights. [quoted text, click to view] "sqlster" <nospam@nospam.com> wrote in message news:BCC4A099-ECF4-4007-850D-3E3CC6E1A698@microsoft.com... >I am trying to follow the example in sql server data mining book by Jamie >and > Tang. > > On page 95, step 3 for creating name calculation on customers table, I > enter > the following expression: > > CASE > WHEN [NUM BEDROOMS] = 1 THEN 'ONE' > WHEN [NUM BEDROOMS] <= 1 THEN 'TWO OR THREE' > WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE' > ELSE 'NONE' > END > > When I click okay, I get the following error: > > IErrorInfo.GetDescription failed with E_FAIL(0x80004005). > > Has this worked for anyone else here or I am missing some thing?? > > TIA...
I am still getting the same error ==== IErrorInfo.GetDescription failed with E_FAIL(0x80004005). === when I enter the following expression. CASE WHEN [NUM BEDROOMS] = 1 THEN 'ONE' WHEN [NUM BEDROOMS] <= 3 THEN 'TWO OR THREE' WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE' ELSE 'NONE' END Please help. TIA.. [quoted text, click to view] "Jamie MacLennan (MS)" wrote: > The third line of the sample is > WHEN [NUM BEDROOMS] <= 3 THEN 'TWO OR THREE' > > -- > > -Jamie MacLennan > SQL Server Data Mining > This posting is provided "AS IS" with no warranties, and confers no rights. > "sqlster" <nospam@nospam.com> wrote in message > news:BCC4A099-ECF4-4007-850D-3E3CC6E1A698@microsoft.com... > >I am trying to follow the example in sql server data mining book by Jamie > >and > > Tang. > > > > On page 95, step 3 for creating name calculation on customers table, I > > enter > > the following expression: > > > > CASE > > WHEN [NUM BEDROOMS] = 1 THEN 'ONE' > > WHEN [NUM BEDROOMS] <= 1 THEN 'TWO OR THREE' > > WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE' > > ELSE 'NONE' > > END > > > > When I click okay, I get the following error: > > > > IErrorInfo.GetDescription failed with E_FAIL(0x80004005). > > > > Has this worked for anyone else here or I am missing some thing?? > > > > TIA... > >
You could try this feature by creating a temp table as follows create table temptbl (id int not null primary key, c1 varchar(33) ) go insert temptbl(id,c1) values(1,'val1') insert temptbl(id,c1) values(2,'val2') insert temptbl(id,c1) values(3,'val3') insert temptbl(id,c1) values(4,'val4') go select * from temptbl go In data source view, after adding the table, you could add a named column as follows: case when id <=2 then 'great' when id >2 then 'greatest' else 'super' end Try exploring the data and it should work. I am not sure on why you are getting this particular error on MovieClick database. HTH... -- http://zulfiqar.typepad.com BSEE, MCP [quoted text, click to view] "sqlster" wrote: > I am still getting the same error > ==== > IErrorInfo.GetDescription failed with E_FAIL(0x80004005). > === > > > when I enter the following expression. > CASE > WHEN [NUM BEDROOMS] = 1 THEN 'ONE' > WHEN [NUM BEDROOMS] <= 3 THEN 'TWO OR THREE' > WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE' > ELSE 'NONE' > END > > Please help. > > TIA.. > > > "Jamie MacLennan (MS)" wrote: > > > The third line of the sample is > > WHEN [NUM BEDROOMS] <= 3 THEN 'TWO OR THREE' > > > > -- > > > > -Jamie MacLennan > > SQL Server Data Mining > > This posting is provided "AS IS" with no warranties, and confers no rights. > > "sqlster" <nospam@nospam.com> wrote in message > > news:BCC4A099-ECF4-4007-850D-3E3CC6E1A698@microsoft.com... > > >I am trying to follow the example in sql server data mining book by Jamie > > >and > > > Tang. > > > > > > On page 95, step 3 for creating name calculation on customers table, I > > > enter > > > the following expression: > > > > > > CASE > > > WHEN [NUM BEDROOMS] = 1 THEN 'ONE' > > > WHEN [NUM BEDROOMS] <= 1 THEN 'TWO OR THREE' > > > WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE' > > > ELSE 'NONE' > > > END > > > > > > When I click okay, I get the following error: > > > > > > IErrorInfo.GetDescription failed with E_FAIL(0x80004005). > > > > > > Has this worked for anyone else here or I am missing some thing?? > > > > > > TIA... > > > >
Here's some questions to try to narrow the issue - it seems unusual. You aren't having any problems browsing the data without the named calculation? Have any named calculations worked? (If you haven't tried, try a named calc with expression '1' and some name) Are you connecting to a SQL database or MS Access database? Thanks -- -Jamie MacLennan SQL Server Data Mining This posting is provided "AS IS" with no warranties, and confers no rights. [quoted text, click to view] "sqlster" <nospam@nospam.com> wrote in message news:7287C5FE-6DFE-42C8-BF05-8883632DC36B@microsoft.com... >I am still getting the same error > ==== > IErrorInfo.GetDescription failed with E_FAIL(0x80004005). > === > > > when I enter the following expression. > CASE > WHEN [NUM BEDROOMS] = 1 THEN 'ONE' > WHEN [NUM BEDROOMS] <= 3 THEN 'TWO OR THREE' > WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE' > ELSE 'NONE' > END > > Please help. > > TIA.. > > > "Jamie MacLennan (MS)" wrote: > >> The third line of the sample is >> WHEN [NUM BEDROOMS] <= 3 THEN 'TWO OR THREE' >> >> -- >> >> -Jamie MacLennan >> SQL Server Data Mining >> This posting is provided "AS IS" with no warranties, and confers no >> rights. >> "sqlster" <nospam@nospam.com> wrote in message >> news:BCC4A099-ECF4-4007-850D-3E3CC6E1A698@microsoft.com... >> >I am trying to follow the example in sql server data mining book by >> >Jamie >> >and >> > Tang. >> > >> > On page 95, step 3 for creating name calculation on customers table, I >> > enter >> > the following expression: >> > >> > CASE >> > WHEN [NUM BEDROOMS] = 1 THEN 'ONE' >> > WHEN [NUM BEDROOMS] <= 1 THEN 'TWO OR THREE' >> > WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE' >> > ELSE 'NONE' >> > END >> > >> > When I click okay, I get the following error: >> > >> > IErrorInfo.GetDescription failed with E_FAIL(0x80004005). >> > >> > Has this worked for anyone else here or I am missing some thing?? >> > >> > TIA... >> >> >>
Hi Jamie, Thanks for addressing this. Here are my answers to clarify the issue. [quoted text, click to view] > You aren't having any problems browsing the data without the named > calculation?
<sqlster> I can browse the date without named calculation.. </sqlster> [quoted text, click to view] > Have any named calculations worked? (If you haven't tried, try a named calc > with expression '1' and some name)
<sqlster> Yes, the one you mentioned does work. </sqlster> [quoted text, click to view] > Are you connecting to a SQL database or MS Access database?
<sqlster> I am connecting to MS access database even though I don't have access installed on vpc2k4 session being used for BIDS or SSMS. </sqlster> [quoted text, click to view] "Jamie MacLennan (MS)" wrote: > Here's some questions to try to narrow the issue - it seems unusual. > > You aren't having any problems browsing the data without the named > calculation? > > Have any named calculations worked? (If you haven't tried, try a named calc > with expression '1' and some name) > > Are you connecting to a SQL database or MS Access database? > > Thanks > -- > > -Jamie MacLennan > SQL Server Data Mining > This posting is provided "AS IS" with no warranties, and confers no rights. > "sqlster" <nospam@nospam.com> wrote in message > news:7287C5FE-6DFE-42C8-BF05-8883632DC36B@microsoft.com... > >I am still getting the same error > > ==== > > IErrorInfo.GetDescription failed with E_FAIL(0x80004005). > > === > > > > > > when I enter the following expression. > > CASE > > WHEN [NUM BEDROOMS] = 1 THEN 'ONE' > > WHEN [NUM BEDROOMS] <= 3 THEN 'TWO OR THREE' > > WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE' > > ELSE 'NONE' > > END > > > > Please help. > > > > TIA.. > > > > > > "Jamie MacLennan (MS)" wrote: > > > >> The third line of the sample is > >> WHEN [NUM BEDROOMS] <= 3 THEN 'TWO OR THREE' > >> > >> -- > >> > >> -Jamie MacLennan > >> SQL Server Data Mining > >> This posting is provided "AS IS" with no warranties, and confers no > >> rights. > >> "sqlster" <nospam@nospam.com> wrote in message > >> news:BCC4A099-ECF4-4007-850D-3E3CC6E1A698@microsoft.com... > >> >I am trying to follow the example in sql server data mining book by > >> >Jamie > >> >and > >> > Tang. > >> > > >> > On page 95, step 3 for creating name calculation on customers table, I > >> > enter > >> > the following expression: > >> > > >> > CASE > >> > WHEN [NUM BEDROOMS] = 1 THEN 'ONE' > >> > WHEN [NUM BEDROOMS] <= 1 THEN 'TWO OR THREE' > >> > WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE' > >> > ELSE 'NONE' > >> > END > >> > > >> > When I click okay, I get the following error: > >> > > >> > IErrorInfo.GetDescription failed with E_FAIL(0x80004005). > >> > > >> > Has this worked for anyone else here or I am missing some thing?? > >> > > >> > TIA... > >> > >> > >> > >
MS Access (i.e. Jet) doesn't support CASE. You have to use IIF, e.g. SELECT *, IIF(AGE>30, 'Yes' , 'No') AS Over30 FROM Customers -- -Jamie MacLennan SQL Server Data Mining This posting is provided "AS IS" with no warranties, and confers no rights. [quoted text, click to view] "sqlster" <nospam@nospam.com> wrote in message news:C839A1CF-BBF7-44FF-BFA0-72FAA2A3B8B0@microsoft.com... > Hi Jamie, > > Thanks for addressing this. Here are my answers to clarify the issue. > >> You aren't having any problems browsing the data without the named >> calculation? > > <sqlster> > I can browse the date without named calculation.. > </sqlster> > >> Have any named calculations worked? (If you haven't tried, try a named >> calc >> with expression '1' and some name) > > <sqlster> > Yes, the one you mentioned does work. > </sqlster> > >> Are you connecting to a SQL database or MS Access database? > > <sqlster> > I am connecting to MS access database even though I don't have access > installed on vpc2k4 session being used for BIDS or SSMS. > </sqlster> > > "Jamie MacLennan (MS)" wrote: > >> Here's some questions to try to narrow the issue - it seems unusual. >> >> You aren't having any problems browsing the data without the named >> calculation? >> >> Have any named calculations worked? (If you haven't tried, try a named >> calc >> with expression '1' and some name) >> >> Are you connecting to a SQL database or MS Access database? >> >> Thanks >> -- >> >> -Jamie MacLennan >> SQL Server Data Mining >> This posting is provided "AS IS" with no warranties, and confers no >> rights. >> "sqlster" <nospam@nospam.com> wrote in message >> news:7287C5FE-6DFE-42C8-BF05-8883632DC36B@microsoft.com... >> >I am still getting the same error >> > ==== >> > IErrorInfo.GetDescription failed with E_FAIL(0x80004005). >> > === >> > >> > >> > when I enter the following expression. >> > CASE >> > WHEN [NUM BEDROOMS] = 1 THEN 'ONE' >> > WHEN [NUM BEDROOMS] <= 3 THEN 'TWO OR THREE' >> > WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE' >> > ELSE 'NONE' >> > END >> > >> > Please help. >> > >> > TIA.. >> > >> > >> > "Jamie MacLennan (MS)" wrote: >> > >> >> The third line of the sample is >> >> WHEN [NUM BEDROOMS] <= 3 THEN 'TWO OR THREE' >> >> >> >> -- >> >> >> >> -Jamie MacLennan >> >> SQL Server Data Mining >> >> This posting is provided "AS IS" with no warranties, and confers no >> >> rights. >> >> "sqlster" <nospam@nospam.com> wrote in message >> >> news:BCC4A099-ECF4-4007-850D-3E3CC6E1A698@microsoft.com... >> >> >I am trying to follow the example in sql server data mining book by >> >> >Jamie >> >> >and >> >> > Tang. >> >> > >> >> > On page 95, step 3 for creating name calculation on customers table, >> >> > I >> >> > enter >> >> > the following expression: >> >> > >> >> > CASE >> >> > WHEN [NUM BEDROOMS] = 1 THEN 'ONE' >> >> > WHEN [NUM BEDROOMS] <= 1 THEN 'TWO OR THREE' >> >> > WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE' >> >> > ELSE 'NONE' >> >> > END >> >> > >> >> > When I click okay, I get the following error: >> >> > >> >> > IErrorInfo.GetDescription failed with E_FAIL(0x80004005). >> >> > >> >> > Has this worked for anyone else here or I am missing some thing?? >> >> > >> >> > TIA... >> >> >> >> >> >> >> >> >>
Thanks Jamie.. [quoted text, click to view] "Jamie MacLennan (MS)" wrote: > MS Access (i.e. Jet) doesn't support CASE. You have to use IIF, e.g. > > SELECT *, IIF(AGE>30, 'Yes' , 'No') AS Over30 > FROM Customers > > -- > > -Jamie MacLennan > SQL Server Data Mining > This posting is provided "AS IS" with no warranties, and confers no rights. > "sqlster" <nospam@nospam.com> wrote in message > news:C839A1CF-BBF7-44FF-BFA0-72FAA2A3B8B0@microsoft.com... > > Hi Jamie, > > > > Thanks for addressing this. Here are my answers to clarify the issue. > > > >> You aren't having any problems browsing the data without the named > >> calculation? > > > > <sqlster> > > I can browse the date without named calculation.. > > </sqlster> > > > >> Have any named calculations worked? (If you haven't tried, try a named > >> calc > >> with expression '1' and some name) > > > > <sqlster> > > Yes, the one you mentioned does work. > > </sqlster> > > > >> Are you connecting to a SQL database or MS Access database? > > > > <sqlster> > > I am connecting to MS access database even though I don't have access > > installed on vpc2k4 session being used for BIDS or SSMS. > > </sqlster> > > > > "Jamie MacLennan (MS)" wrote: > > > >> Here's some questions to try to narrow the issue - it seems unusual. > >> > >> You aren't having any problems browsing the data without the named > >> calculation? > >> > >> Have any named calculations worked? (If you haven't tried, try a named > >> calc > >> with expression '1' and some name) > >> > >> Are you connecting to a SQL database or MS Access database? > >> > >> Thanks > >> -- > >> > >> -Jamie MacLennan > >> SQL Server Data Mining > >> This posting is provided "AS IS" with no warranties, and confers no > >> rights. > >> "sqlster" <nospam@nospam.com> wrote in message > >> news:7287C5FE-6DFE-42C8-BF05-8883632DC36B@microsoft.com... > >> >I am still getting the same error > >> > ==== > >> > IErrorInfo.GetDescription failed with E_FAIL(0x80004005). > >> > === > >> > > >> > > >> > when I enter the following expression. > >> > CASE > >> > WHEN [NUM BEDROOMS] = 1 THEN 'ONE' > >> > WHEN [NUM BEDROOMS] <= 3 THEN 'TWO OR THREE' > >> > WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE' > >> > ELSE 'NONE' > >> > END > >> > > >> > Please help. > >> > > >> > TIA.. > >> > > >> > > >> > "Jamie MacLennan (MS)" wrote: > >> > > >> >> The third line of the sample is > >> >> WHEN [NUM BEDROOMS] <= 3 THEN 'TWO OR THREE' > >> >> > >> >> -- > >> >> > >> >> -Jamie MacLennan > >> >> SQL Server Data Mining > >> >> This posting is provided "AS IS" with no warranties, and confers no > >> >> rights. > >> >> "sqlster" <nospam@nospam.com> wrote in message > >> >> news:BCC4A099-ECF4-4007-850D-3E3CC6E1A698@microsoft.com... > >> >> >I am trying to follow the example in sql server data mining book by > >> >> >Jamie > >> >> >and > >> >> > Tang. > >> >> > > >> >> > On page 95, step 3 for creating name calculation on customers table, > >> >> > I > >> >> > enter > >> >> > the following expression: > >> >> > > >> >> > CASE > >> >> > WHEN [NUM BEDROOMS] = 1 THEN 'ONE' > >> >> > WHEN [NUM BEDROOMS] <= 1 THEN 'TWO OR THREE' > >> >> > WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE' > >> >> > ELSE 'NONE' > >> >> > END > >> >> > > >> >> > When I click okay, I get the following error: > >> >> > > >> >> > IErrorInfo.GetDescription failed with E_FAIL(0x80004005). > >> >> > > >> >> > Has this worked for anyone else here or I am missing some thing?? > >> >> > > >> >> > TIA... > >> >> > >> >> > >> >> > >> > >> > >> > >
Don't see what you're looking for? Try a search.
|
|
|