PC Review


Reply
Thread Tools Rate Thread

Changing a SQL Instuction

 
 
gatarossi@ig.com.br
Guest
Posts: n/a
 
      29th Aug 2007
Dear all,

I'm trying to do a consult in access from excel, but I donīt know how
to change the information of the field lote_contabil ('RT0101' AS
Expr1). This is a text that I put in my INSERT INTO consult, but I
need to connect others informations; in a excel formula it looks like:

="RT0"&razao_contabil.ano_mes&"0"&razao_contabil.codigo_cenario

But how can I adapt it in this SQL instruction?

strSQL = "INSERT INTO razao_contabil ( codigo_conta_contabil,
codigo_centro_custo, codigo_cenario, orc_real, ano_mes, lote_contabil,
historico_lancamento, valor_transacao ) "
strSQL = strSQL & "SELECT rateio.codigo_conta_contabil_destino,
rateio.codigo_centro_custo_destino, razao_contabil.codigo_cenario,
razao_contabil.orc_real, razao_contabil.ano_mes, 'RT0101' AS Expr1,
'MOVTO. RATEIO' AS Expr2,
([razao_contabil.valor_transacao]*[rateio.percentual_alocacao])*-1 AS
valor_rateio "
strSQL = strSQL & "FROM razao_contabil INNER JOIN rateio "
strSQL = strSQL & "ON (razao_contabil.codigo_centro_custo =
rateio.codigo_centro_custo_origem) AND
(razao_contabil.codigo_conta_contabil =
rateio.codigo_conta_contabil_origem) "
strSQL = strSQL & "WHERE ((razao_contabil.orc_real)='orc') AND
((rateio.codigo_cenario)='1') ;"

Thanks a lot!!!

André.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing row height in a data grid without changing font size =?Utf-8?B?S2FzZXk=?= Microsoft C# .NET 1 30th Jun 2006 12:20 AM
How to stop entire document style changing when changing 1 line? =?Utf-8?B?VHJveSBBLiBDb3VydG5leQ==?= Microsoft Word Document Management 4 1st May 2005 11:10 PM
Keeping Calendar times from changing when changing local time zone. George Lob Microsoft Outlook Discussion 1 22nd Nov 2004 05:14 PM
Difficulty in changing the Connection Server control path changing ... Samridhi Kumar Shukla Microsoft ASP .NET 1 30th Nov 2003 02:31 AM
Instuction notes that must not appear in the printed document Claire Microsoft Word New Users 1 13th Oct 2003 04:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:22 AM.