Showing posts with label particular. Show all posts
Showing posts with label particular. Show all posts

Friday, March 30, 2012

How to construct SQL SELECT statement

I want to search an entire table for a particular keyword but i'm not sure how, if the keyword was TEST then I want to return rows where any of the fields contain TEST, THIS IS A TEST, PLEASE TEST THIS etc etc i.e. the keyword can be anywhere in the fields value

I believe I need to use the LIKE clause but i'm not sure how.

Thanks

BenSelect * From Table Where Field Like '%' + sSearch.Replace("'","''") + '%'|||Hi Ben,

You're right, you can use the LIKE clause,
E.g.
SELECT * FROM Students WHERE StudentName LIKE '%NEW%'

Then the matched records include: HAPPY NEW YEAR and ASP.NEW :)

Regards,|||Hi Colt, thanks for that

If I wanted to apply the search to more than one fields could I use

SELECT * From Students WHERE StudentName, Field2, Field3, Field4 LIKE '%NEW%'

Is that the correct syntax?

Ben|||Hi,

You may try:


SELECT *
From Students
WHERE StudentName LIKE '%NEW%' OR
Field2 LIKE '%NEW%' OR
Field3 LIKE '%NEW%' OR
Field4 LIKE '%NEW%'

Regards,

Sunday, February 19, 2012

How to choose the default hierarchy for a dimension?

I created a server-time dimension and generated several hierarchies within the same dimension, does anyone know how to select a particular hierarchy as the default one?

I didn't see it on the properties for the dimension or hierarchy.What is default hierarchy semantics that you are looking for ? I.e. what will it be used for ? What special treatment will it receive ?|||It's a time dimension and there are 3 hierarchies defined:
Reporting Year -> Reporting Quarter
Year - Quarter - Month - Date
Year - Week - Date

It seems as though the Reporting Year -> Reporting Quarter hierarchy is used by default, how would I change the configuration to use a different hierarchy by default?|||

Can you please explain what do you mean by

"It seems as though the Reporting Year -> Reporting Quarter hierarchy is used by default"

|||The 'first' heirarchy is the default hierarchy. IE: The left most heirarchy in your model.

C|||Chris - can you please explain what does "default hierarchy" means in AS ? Thanks !|||From your browsing client, If you grab a Dimension containing multiple hierarchies, and drag it over (by whatever means you're using) to your Rows, or Columns, or Filter etc... it will show your default hierarchy.|||Ah, that explains it. Sorry for my confusing terminology. Thanks, Chris + Mosha.

How to check whether Server is Exists with some Table in Particular Database.

hi,

I want to know through applicaiton how to check whether the Server named"Myserver" is Exists with Database named "MyDatabase" with Tables named ('Table1','Table2','Table3').

For any Database like (MS Access, Oracle, MS SQL-Server,MySQL)..

Please help me.....

thank's in advance.......

Paresh Patel.

Paresh.onmail@.hotmail.com

The syntax would be a bit different for different databases, but basically I believe that the procedure would be the same for all..

You'd have to:

1) connect and login to the server 'Myserver'
2) ask it if 'MyDatabase' exist (eg try use MyDatabas)
3) check for existence of 'Table1', 'Table2' etc (eg try access tables, check for objectnames etc)

You'd also need to know a valid login with appropriate permissions to do this.

/Kenneth