You didn't mention what database it is. For SQL Server, the query might be something like this
SELECT order_no, order_line_no, line_type, product, long_description + ' ' + (SELECT B.long_description FROM Table1 B WHERE B.line_type = 'C'AND A.order_no = B.order_no AND A.product = B.product) AS long_description
FROM Table1 A
WHERE line_type = 'P'
'Insert the New receipt
Dim SQL As String = "Insert into Receipts (ReceiptDate,ReceiptTotal) values ( :1)"
Dim CMD1 As New OleDb.OleDbCommand
CMD1.Connection = Myconnection
CMD1.Transaction = CustomerTrans
CMD1.CommandText = SQL
CMD1.Parameters.AddWithValue(" ", Now.Date)
i AM Using Access 2007 and I set t
ANY HELP GIVEN IS HIGHLY APPRECIATED. i TRIED ALMOST ALL I CAN THINK OF.
Thanks for the quick response. Although I have learned something new in the article you posted, I still can't find what the problem is with my code.
What am I doing wrong? it looks valid syntax to me, but what do I know, I am new to this. I have been reading about INSERT INTO statement all day long and can't find whats wrong with my code.
You're more familiar with what exactly you are doing.
Typically, names aren't allowed to start with a digit.
My experience with Access (via OleDb) is that question marks (?) are preferred, but that names can be used if they're kept in order (as yours are).
I have also only see a colon (:) used for parameter names in Oracle.
I was just guessing, based on the fact that there would generally be a comma separator in such expressions. However, from the further messages it seems that OP had not checked the documentation for proper format of the command.
Hello experts. I have noticed something that is unfamiliar to me in my database knowledge.
My application creates tables and inserts initial values into them based on user specifications. More than two tables are created in the process. The table creation and inserts are done within a transaction. When an error occurs, the transaction is rolled back.
I just noticed that when the transaction is rolled back, all inserts are erased as expected. However, the tables created within the transaction are not dropped from the database. This is unusual to me. I don't know if I am missing something or that is how it happens with SQL server (2008 R2).
Is there any way the tables can be dropped without specifying them one at a time in code? Please help.
I Change the language for the database in Sql Server 2008 ( To Arabic_CI_AS )via the optional tab in database proprieties .
but when i Insert new record( have Arabic Text) in any table the text change to ???? .
actually the problem is that my project manager has asked me to do a project of merging different databases in sql server 2008 these databases are on oracle, my sql and sql server now the problem is that the database have a column of unicode data
Is these differences are correct or not as interviewer said me these are incorrect....please guide me...
Difference between function and SP
Procedure can return zero or n values whereas function can return one value which is mandatory.
Procedures can have input/output parameters for it whereas functions can have only input parameters.
Procedure allows selectas well as DML statement in it whereas function allows only select statement in it.
Functions can be called fromprocedure whereas procedures cannot be called fromfunction.
Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function.
How can I get the total number of two types of transaction between two dates per user
User TransactionType MovementDate
Avril RECP 2012/01/04
Pat RECP 2012/01/09
Pat SRET 2012/01/09
What I would like is the following:
User Recipts Returns
Avril 1 0
Pat 1 1
This is where I was heading, but as soon as I put in a where clause to limit the date range I get an Error " Incorrect column expression: 'SUM(CASE WHEN stkhistm.transaction_type = 'RECP Then 1 else 0 end)'
SELECT SUM(CASE WHEN stkhstm.transaction_type = 'RECP' then 1else0 end) , SUM(CASE WHEN stkhstm.transaction_type = 'SRET' then 1else0 end)
FROM vektron.scheme.stkhstm stkhstm