I am using SQL Server 2012 and VS 2012 C# I have designed database table Roll_No, Attend_Date, Attend_Status while storing data i store like this But I have to show in grid-view like this Can you Help me please… How can I achieve this result.. Answer You can do this by listing each date as column name w…
Tag: sql
Import data from Excel Wizard automatically detects data types
Hello I’m trying to import data from excel file (xls) to new SQL table so I use Import and Export data 32/bit to achieve that. When I load the excel file it automatically detects data types of columns. e.g. column with phone numbers is as data type to new table float and in excel is as Double(15) when I…
MySQL not showing databases created in phpMyAdmin
I’m trying to build a database for my server in phpmyadmin but when I finish building it I can’t access it using PHP and it won’t show when I list the databases in MySQL. But when I create a database in mySql it shows up in phpmyadmin. Also I’m running phpmyadmin version 4.0.3, and the…
Stored Procedure Return Type Can Not Be Detected
I am trying to drag this procedure over to the dbml in VS 2012 and I am getting the return type cannot be detected message. I have tried these: LINQ to SQL – Stored Procedure Return Type Error The …
SQL Server: how to find closest location?
I have two tables, Houses and Stores. Both have Latitude and Longitude fields. I need to make a view that would return for each record in Houses HouseId and StoreId, where StoreId is the ID of the …
How to calculate running total (month to date) in SQL Server 2008
I’m trying to calculate a month-to-date total using SQL Server 2008. I’m trying to generate a month-to-date count at the level of activities and representatives. Here are the results I want to generate: From the following tables: ACTIVITIES_FACT table LU_TIME table I’m not sure how to do thi…
set decimal places of sum in sql
I have a database I use for a debating competition I am trying to sort the standings out to see which schools will play off in the finals at the end of the semester. I have this working as shown below however I am not able to round the ptc field, it currently returns up to 4 decimal places eg
Optimize performance for queries on recent rows of a large table
I have a large table: CREATE TABLE “orders” ( “id” serial NOT NULL, “person_id” int4, “created” int4, CONSTRAINT “orders_pkey” PRIMARY KEY (“id”) ); 90% of all requests are about orders from the …
Month difference between two dates in sql server
Please refer the below examples and kindly let me know your ideas. Output = 3 expected output = 2.5 Since I have only 15 days in Nov, So I should get 0.5 for Nov Answer Try this OR
inflation calculation in MS SQL
I have the below requirement to fulfill. How to achieve this simplistically. There is an inflation rate table as below I need to first get And then get Answer I think the best way to do this on SQLserver is to use a common table expression with recursion. I’m not 100% sure because I can’t test it …