Field as column in SQL Server 2005 Programming Databases by duke_swh … SET @Column = (SELECT Column2 FROM @t2 WHERE ID = @i) SET @SQL = @SQL + 'CASE WHEN Parameter = ''' + @Column + ''' THEN Rating END AS [' + @Column + ']' + CHAR(13…) SET @i = @i + 1 IF @i <= @Max SET @SQL = @SQL + ',' END SET @SQL = @SQL + ', Cast(Convert(varchar(8),RatedOn, 112) as Datetime), FROM… Re: SQL Group By Postcode Area Programming Databases by sknake Try something like [code=sql] (case when code like '[a-Z][a-Z]%' then substring 2 else substring one end) [/code] finish the substring part. I'm on my phone and non alpha chars are hard to use Firebird and PHP (or help with PHP Generator) Programming Web Development by coolmike …"]; if (!isset($page)) $page = 1; $sql = @$_POST["sql"]; switch ($sql) { case "insert": sql_insert(); break; case "update": sql_update(); break… Re: Get data out of excel file stored as an image Programming Databases by M_K_Higa Ok. One more thing (and I use this technique a lot). You can conditionally inject a zero to your string data based on conditions. [code=SQL] case when ((cast(f1 as int) > -10) or (cast(f1 as int) < 10)) then '0' + f1 else f1 end [/code] This code will inject a '0' in front of any single digit number. Re: Hope someone is clever! Programming Databases by BitBlt … do your calculations and replace your IF statement with a SQL CASE statement. Some more detail about how your data is structured… Re: sqlserver and asp.net c# Programming Web Development by kvprajapati Use (MS-SQL) CASE construct. [code] ... CASE WHEN STATUS=1 THEN AttendenceTime else ' ' END as TimeIn, CASE WHEN STATUS=0 THEN AttendenceTime else ' ' END as TimeOut ... [/code] Re: recheck n enter to database Programming Software Development by jireh ….databasejournal.com/features/postgresql/article.php/3437821/SELECT-DISTINCT-A-SQL-Case-Study.htm[/url] Re: compare multiple table joining with value Programming Databases by tesuji … Kjwb1 by 2.5 or 0 is usually done by sql CASE function. -- tesu SQL Question / Stuck !! Programming Databases by olegb SQL Gurus, help !! I have a table with 3 fields, ID, … to make 'Now' equal today's date: select id, answer_5, CASE when answer_6 = 'Now' THEN cast(GETDATE() as date) when answer_6… Re: How To Order By Adding Total Of All Columns In SQL? Programming Web Development by Fifth Horseman $sql = "SELECT * from keywords WHERE kw1 = ? OR kw2 = ? OR kw3 = ? … Re: SQL validation of username and password Programming Software Development by Reverend Jim SQL queries are normally case insensitive, however you can force a query to be case sensitive. In the following two queries, …the first is case insensitive and the second is case sensitive select * from myTable where myID =…want to set one or more columns to be case sensitive by default you can do ALTER TABLE … Re: Sql??????? Programming Web Development by ~s.o.s~ … than a language. The Database packages which implement SQL are Oracle, MySQL, MS SQL Server 2005, etc. to name a few. …plus on your side if you knew the basics of SQL before attempting to tacke server side scripting languges like PHP… GTK+. If that is the case then you dont need to know SQL. [URL]http://www.w3schools.com/sql/default.asp[/URL] [URL… Re: SQL - Maybe Google Maps - Dynamic data Programming Web Development by LastMitch >SQL - Maybe Google Maps - Dynamic data **@Gloak** What do you want? … Re: Database connection string error! Programming Software Development by Momerath SQL Server connections used named parameters, rather than the '?' of an … figure it out. It also cuts down on errors in case you do add them in the 'wrong' order. Also, in… the statement above you don't have to capitalize the SQL commands, it's just a habit I have to help… Re: Basic PHP - MYSQL Programming Web Development by pritaeas $sql = "INSERT INTO Customers( ClientName, ContactName, Date column is missing … NOW (and the comma after $contactname). Use `mysql_real_escape_string`, all lower case. Re: Help make sure date is saved properly Programming Web Development by almostbob sql/mysql/mssql/postgresql now() php date() functions already exist text format dates are stupid Re: Need to get search results based upon selected skills Programming Databases by blocblue SQL really isn't one of my strong skills, so the … Re: What will happen if primary key value exceeds range Programming Databases by adam_k SQL can handle up 18,446,744,073,709,551,615 … Re: xxxx.text not declared problem. Programming Web Development by Sarama2030 Sql strings are surrounded with single quotes like 'parameter value'.Use single quotes and see what happens Re: Assistance Needed from PHP experts Programming Web Development by adebayo.sas SQL FILE -- Database: `casem` -- -- -------------------------------------------------------- -- -- Table structure for table `asgc` -- CREATE TABLE … Re: Unable to parse query text. Programming Software Development by Ketsuekiame SQL is case sensitive. `A` and `a` are different aliases.… using MySQL and not MSSQL. MySQL is not case sensitive, however, the Visual Studio parser *might*… thing of nightmares... Note: Try and keep case sensitivity tbh, not adhering to that will lead… cross compatibility. For example; Whilst MySQL is not case-sensitive on Windows, it *is* on UNIX (… Re: How to update myphp database using php forms Programming Web Development by sibbs06 > $sql = "UPDATE property SET pricesoldfor = $pricesoldfor WHERE propertyID = '$propertyID'"; … /var/www/vhosts/numyspace.co.uk/web_users/home/~unn_v013362/public_html/case/MakeBid.php on line 83 You have any idea what… Re: how to select latest or last row in a table Programming Databases by aksclusive sql query for retrieving last row particular column value depending upon ….. the above Query help you to retrieve last row in case when you don't the index contain value. SQL Case Statement Programming Databases by kahaj … need of a better understanding of SQL. I'm trying to write a query using CASE statements (as this seems to be… Re: SQL Case Statement Programming Databases by rch1231 Hello, I happen to be a big fan of SQL's capability to do a auery within a query (somtimes … Re: SQL Question / Stuck !! Programming Databases by AleMonteiro I'd go with something like this: SELECT id, answer_5, CASE WHEN answer_6 = 'Now' THEN cast(GETDATE() as date) WHEN answer_6 IS NULL THEN cast('1990-01-01' as date) ELSE cast(answer_6 as date) END AS new_answer_6 FROM tDataMult SQL query CASE WHEN THEN Programming Web Development by klemme … and pull out that total. I want to use the CASE keyword and tjeck for this, but am doing something wrong… keep getting an error. This is my code: $sql = SELECT pris, skin_year, ialt, CASE ialt WHEN 0 THEN ialt = SUM('ær,vedrur… SQL Server, Like Part Numbers in Different Warehouses Programming Databases by Papa_Don Group, I'm discovering that the SQL Server tables don't like identical (in this case) Part Numbers, even though one of the…, it is the "Location"). FYI.... I'm using SQL Server 2008 Express for my testing. With this said, I… Re: SQL query CASE WHEN THEN Programming Web Development by pritaeas I think it should be: SELECT pris, skin_year, CASE ialt WHEN 0 THEN SUM(ær,vedrur,lamp) ELSE ialt END AS ialt FROM skind_statistik WHERE kunde_id = x Can't test right now. Re: SQL Server, Like Part Numbers in Different Warehouses Programming Databases by adam_k … internet and push info in it. This way if somebody SQL injects into my db, it wouldn't matter as my…