Sqlstatement

May 4, 2007

In first .aspx page in a gridview  iam taking the Names from Produts and count from Productlist.

Names        products

aaaa            2

bbbb            2

cccc             1

In the second page in a gridview. when i click on the aaaa i want the values of produts and the count of prodution from productionmaker.

productlist looks as

Names      products

aaaa           uuuy

bbbb          jkkkkkj

aaaa         lyuuu

bbbb         uyuyu

my productionmaker looks as

Names     produts         production       makerk

aaaa           jkkkkkj         uuuuuu           jtyty

bbbb           uyuyu           yyyyyy            iiiiiiii

aaaa           jkkkkkj         ytuuuyyy            rerer

bbbb           uyuyu             xxxxxx          iuooi

when iam using this sql statement

"SELECT [Productlist].[products], Count([productmaker].[production]) AS [Totalproduction] FROM [productlist] LEFT JOIN [productmaker] ON [productmaker].[production] = [productlist].[products] GROUP BY [productlist].[product]

iam getting the output as

products      totalprodution 

jkkkkkj          0

uyuyu           0

i want the output in second.aspx page.

products              totalproduction

jkkkkj                       2   

uyuyu                       2   

View 6 Replies


ADVERTISEMENT

Sqlstatement (date Convert)

Jun 27, 2007

Looking for the way to convert a datetime field to only show the date (no time) in a gridview that is dynamically created by the statement. 
string sqlStatement = "SELECT [column1], [column 2], [column 3]... FROM tbl  WHERE ...  I am trying to convert column 2 to the date without the time.

View 2 Replies View Related

Integer Variable Usage In SqlStatement Expression

Apr 27, 2007

I have an integer variable which i had to cast as a string in order for it to show as an integer in the sql expression which is a string in order for it to INSERT as an integer? Read that 5 times fast!!!





"INSERT INTO Table( SourceFileName, ProcessStartTime, ProcessEndTime, Processed, RowCountFlatFile, RowCountCleanInsert, RowCountDataConversionErrors, RowCountPKViolation, RowCountDuplicateInvoiceIDInSourceFile, RowCountISNULLCase1, RowCountISNULLCase2, RowCountConditionalSplit)
VALUES( '"+ @[User:aymentFileName] +"',
'"+ (DT_STR, 20, 1252)@[System:tartTime]+ "',
'"+ (DT_STR, 20, 1252)@[System:tartTime]+ "',
1,
"+(DT_STR, 4, 1252)@[User::rcSourceFile]+",
"+(DT_STR, 4, 1252)@[User::rcCleanInserts]+",
"+(DT_STR, 4, 1252)@[User::rcDataConversionErrors]+",
"+(DT_STR, 4, 1252)@[User::rcPKViolation]+",
"+(DT_STR, 4, 1252)@[User::rcExistingInvoiceID]+",
"+(DT_STR, 4, 1252)@[User::rcISNULLCase1] +",
"+(DT_STR, 4, 1252)@[User::rcISNULLCase2] +",
"+(DT_STR, 4, 1252)@[User::rcConditionalSplitErrors]+"
)"

all the variable beginning with rc are Int32 variables being loaded using the Row Count task. they are being inserted into an integer field in the table. Is this whack or what???



I was trying to cast is using DT_I4 but couldn't find any samples nor could I get it to work. The above is successful!!!

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved