Convert This Access Code To Sql

Jun 24, 2008

Hello does anyone know how to convert this access code to sql. Also is there a program out there that will do it for you.

IIf([Ceridian]![UnionIndicator]="U" And [YearsService]>=3,[HealthBenefits]![medplan.Bi-WeeklyURBio-Rad]*26,[HealthBenefits]![medplan.Bi-WeeklyBio-Rad]*26) AS MedicalCostER, IIf([Ceridian]![UnionIndicator]="U" And [YearsService]>=3,[medplan]![Bi-WeeklyUREE]*26,[medplan]![Bi-WeeklyEE]*26) AS MEdicalCostEE

View 1 Replies


ADVERTISEMENT

Convert VBA Code To SQL Sp

Apr 10, 2008

I'd like to convert this vba code from access to run in sql 2000 and I'm a newbie to vba and am not sure how to do this. can I get the same functionality from an sp?
' Global SYSTEM Variables...
Global GBL_SystemName As String
Global GBL_CommonPath As String
Global GBL_WorkPath As String
Global GBL_DataUpdatePath As String
Global GBL_ArchivePath As String
Global GBL_LiveMarsPath As String
Global GBL_MARS_DSN_Name As String
Global GBL_MARS_DB_Server As String
Global GBL_MARS_DB_Name As String
Global GBL_RawData_DSN_Name As String
Global GBL_RawData_DB_Server As String
Global GBL_RawData_DB_Name As String
' Global CLIENT Variables...
Global GBL_ClientName As String
Global GBL_ClientAbbrev As String
Global GBL_MedisunEligibilityAge As Long
Global GBL_DoctorsManualEntryFlag As String
Global GBL_LastUpdateDate As Date
Global GBL_LastInvoiceGTEDate As Date
Global GBL_LastInvoiceLTEDate As Date
Global GBL_NewInvoiceGTEDate As Date
Global GBL_NewInvoiceLTEDate As Date


Public Function Get_Globals(G_name As String)
Select Case UCase(G_name)
Case UCase("SystemName")
Get_Globals = GBL_SystemName
Case UCase("ClientName")
Get_Globals = GBL_ClientName
Case UCase("ClientAbbrev")
Get_Globals = GBL_ClientAbbrev
Case UCase("MedisunEligibilityAge")
Get_Globals = GBL_MedisunEligibilityAge
Case UCase("LastUpdateDate")
Get_Globals = GBL_LastUpdateDate
Case UCase("LastInvoiceGTEDate")
Get_Globals = GBL_LastInvoiceGTEDate
Case UCase("LastInvoiceLTEDate")
Get_Globals = GBL_LastInvoiceLTEDate
Case UCase("NewInvoiceGTEDate")
Get_Globals = GBL_NewInvoiceGTEDate
Case UCase("NewInvoiceLTEDate")
Get_Globals = GBL_NewInvoiceLTEDate
Case UCase("WorkPath")
Get_Globals = GBL_WorkPath
Case UCase("DataUpdatePath")
Get_Globals = GBL_DataUpdatePath
Case UCase("ArchivePath")
Get_Globals = GBL_ArchivePath
Case UCase("LiveMarsPath")
Get_Globals = GBL_LiveMarsPath
Case UCase("CommonPath")
Get_Globals = GBL_CommonPath
Case UCase("MARS_DSN_Name")
Get_Globals = GBL_MARS_DSN_Name
Case UCase("MARS_DB_Server")
Get_Globals = GBL_MARS_DB_Server
Case UCase("MARS_DB_Name")
Get_Globals = GBL_MARS_DB_Name
Case UCase("RawData_DSN_Name")
Get_Globals = GBL_RawData_DSN_Name
Case UCase("RawData_DB_Server")
Get_Globals = GBL_RawData_DB_Server
Case UCase("RawData_DB_Name")
Get_Globals = GBL_RawData_DB_Name
Case UCase("DoctorsManualEntryFlag")
Get_Globals = GBL_DoctorsManualEntryFlag
End Select
End Function

Public Sub GetProperties(strPropertyTblName As String, Optional strClientCode As String)
' Create database connection and recordset...
Set con = Application.CurrentProject.Connection
Set rs = CreateObject("ADODB.Recordset")
strSQL = "select * from tln_" & strPropertyTblName & "Properties"
If UCase(Trim(strPropertyTblName)) = "CLIENT" Then
strSQL = strSQL & " where CPClientCode = '" & strClientCode & "'"
End If
rs.Open strSQL, con, 1 ' 1 = adOpenKeyset
If Not rs.EOF Then
Do While Not rs.EOF
Select Case UCase(Trim(rs("PropertyName")))
Case UCase("MARS_DSN_Name")
GBL_MARS_DSN_Name = rs("PropertyValue")
Case UCase("MARS_DB_Server")
GBL_MARS_DB_Server = rs("PropertyValue")
Case UCase("MARS_DB_Name")
GBL_MARS_DB_Name = rs("PropertyValue")
Case UCase("RawData_DSN_Name")
GBL_RawData_DSN_Name = rs("PropertyValue")
Case UCase("RawData_DB_Server")
GBL_RawData_DB_Server = rs("PropertyValue")
Case UCase("RawData_DB_Name")
GBL_RawData_DB_Name = rs("PropertyValue")
Case UCase("SystemName")
GBL_SystemName = rs("PropertyValue")
Case UCase("ClientName")
GBL_ClientName = rs("PropertyValue")
Case UCase("ClientAbbrev")
GBL_ClientAbbrev = rs("PropertyValue")
Case UCase("MedisunEligibilityAge")
GBL_MedisunEligibilityAge = rs("PropertyValue")
Case UCase("WorkPath")
GBL_WorkPath = rs("PropertyValue")
If Right(Trim(GBL_WorkPath), 1) <> "" Then
GBL_WorkPath = GBL_WorkPath & ""
End If
Case UCase("DataUpdatePath")
GBL_DataUpdatePath = rs("PropertyValue")
If Right(Trim(GBL_DataUpdatePath), 1) <> "" Then
GBL_DataUpdatePath = GBL_DataUpdatePath & ""
End If
Case UCase("ArchivePath")
GBL_ArchivePath = rs("PropertyValue")
If Right(Trim(GBL_ArchivePath), 1) <> "" Then
GBL_ArchivePath = GBL_ArchivePath & ""
End If
Case UCase("LiveMarsPath")
GBL_LiveMarsPath = rs("PropertyValue")
If Right(Trim(GBL_LiveMarsPath), 1) <> "" Then
GBL_LiveMarsPath = GBL_LiveMarsPath & ""
End If
Case UCase("CommonPath")
GBL_CommonPath = rs("PropertyValue")
If Right(Trim(GBL_CommonPath), 1) <> "" Then
GBL_CommonPath = GBL_CommonPath & ""
End If
Case UCase("DoctorsManualEntryFlag")
GBL_DoctorsManualEntryFlag = UCase(rs("PropertyValue"))
If Trim(GBL_DoctorsManualEntryFlag) = "" Then
GBL_DoctorsManualEntryFlag = "Y"
End If
Case Else
' Invalid property... do nothing...
End Select
rs.MoveNext
Loop
End If
rs.Close

Set rs = Nothing
Set con = Nothing
End Sub

View 13 Replies View Related

C# Code Convert To SSIS

Jul 5, 2007

Hi, all

I've seach the threads before. a lot of discussion about C# to VSA.

So could anyone with experience on conversion from C# to SSIS/VSA give me a suggestion?

I 've C# code application which complete some ETL process. Now I need to convert all the ETL process to SSIS pacakge. the function of part of C# code is to get the result from stored procedure and then write the result to excel file, not row by row.



the C# code call Microsoft.Office.Interop.Excel as a object to write excel file.

But in VSA, I can't add Microsoft.Office.Interop.Excel as a reference so I can convert C# to VB.net regarding writing excel file.



So any solution about that?

any help will be appreciated.........

View 5 Replies View Related

Convert SQL Code To Stored Proc

Dec 23, 2004

Dear All,

Lately i have started to convert my sql code to stored procedures, however i am still a bit new on this matter.

I have the following Sql Statement which I wish to convert to a stored procedure:-

SELECT MAX(" & id & ") As maxID FROM " & table

where id and table are parameters that I am passing to this sql from a function which is called getMaxID

for example, in the vb.net code i call it as follows:-

getMaxID("personID", "persons")

Can anyone tell me how to convert it to a Stored Proc please

Thanks for your help and time

Johann

View 2 Replies View Related

Convert String From Textbox To Int - SQL Code

Jan 14, 2008

How do I convert for example, a value comming from C# app "TextboxGBDataDeleted" to int column GBdatadeleted? I have a RangeValidator on this textbox to accept only numbers. I don't want to write C# code. I woul prefer to do this is SQL. Thank you.

My SQL update statement:

INSERT INTO KPITbl
(Lead, WRM, PTDB, PAR, PM, RequestingLOB, LOB, StartLocation, FinishLocation, Description, ProjectType, ServerName, ServerType, DCOorSTANDALONE, Responsible,
Status, RAG, StartDates, EndDates, TreeOrDomainImpacted, NumOfSites, NumOfUsers, GBdatamoved, GBdatadeleted, NumOfSrvrsAdded,
NumOfSrvrsDecommed, NumOfAppsDeployed, EUTEngineeringConsult, Comments, TimeSpend, Complexity, ECM, LastUpdated)
VALUES (@Lead,@WRM,@PTDB,@PAR,@PM,@RequestingLOB,@LOB,@StartLocation,@FinishLocation,@Description,@ProjectType,@ServerName,@ServerType,@DCOorSTANDALONE,@Responsible,@Status,@RAG,@StartDates,@EndDates,@TreeOrDomainImpacted,@NumOfSites,@NumOfUsers,@GBdatamoved,@GBdatadeleted,@NumOfSrvrsAdded,@NumOfSrvrsDecommed,@NumOfAppsDeployed,@EUTEngineeringConsult,@Comments,@TimeSpend,@Complexity,@ECM,(getdate() ) )

~~~~~~~~~~~~~~~~~~~~~~MY TABLE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CREATE TABLE [dbo].[KPITbl](
[TaskID] [int] IDENTITY(1,1) NOT NULL,
[Lead] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[WRM] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PTDB] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PAR] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PM] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[RequestingLOB] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LOB] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[StartLocation] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FinishLocation] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Description] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ProjectType] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ServerName] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ServerType] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Responsible] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Status] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[RAG] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[StartDates] [smalldatetime] NULL,
[EndDates] [smalldatetime] NULL,
[TreeorDomainImpacted] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[NumOfSites] [int] NULL,
[NumOfUsers] [int] NULL,
[GBdatamoved] [int] NULL,
[GBdatadeleted] [int] NULL,
[NumOfSrvrsAdded] [int] NULL,
[NumOfSrvrsDecommed] [int] NULL,
[NumOfAppsDeployed] [int] NULL,
[EUTEngineeringConsult] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Comments] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TimeSpend] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Complexity] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LastUpdated] [smalldatetime] NULL,
[DCOorSTANDALONE] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ECM] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[StatusCompletedDate] [smalldatetime] NULL,
[StatusCancelledDate] [smalldatetime] NULL,
CONSTRAINT [PK_Sheet1a] PRIMARY KEY CLUSTERED
(
[TaskID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

View 4 Replies View Related

How To Convert Pl/sql Code Of Oracle To Something Equivalent Which Works On Sql Server 7.0?

Dec 21, 2000

i had worked on oracle 8i and i am planning to work on sql server 2000,i am requested by a company to help in converting there pl/sql code of oracle 8.0 to something equivalent which works on sql server 7.0 as they want to have similar code on both..i had not worked on sql server 7.0 ,but as pl/sql code works only on oracle stuff..so could kindly anyone guide me in this as to whether there is any product which coverts pl/code (the existing pl/code runs into thousands of line) automatically..i will be very grateful if anyone can enlighten me with such a product(software) or script.. along with its information and site address..any resources and any guidance as to how to go about about this conversion will be very invaluable..hope to hear soon from you guys...early response....will be appreciated..

with regards,

vijay.

sql server 7.0 on winnt
pl/sql code on oracle 8.0

View 2 Replies View Related

Need To Convert This SQL2000 DTS Validation Code To SQL2005 SSIS

Aug 8, 2006

Hello,



How do I convert VBSCRIPT code in a DTS package which is used for data validation to SQL 2005 SSIS?



Thanks,



Michael

View 2 Replies View Related

Transact SQL :: Convert Numbers To ASCII Code In Server

Jul 29, 2015

This is a string i am getting from sql server.

00000006637120150522187449637100  34                                                              
10-000000003444378351108502007                                                                  
  01016800002413                                                                    
10-000000091541378538466562009                                                                  
  01016800002420                                                                    
                                      
[Code] .....

View 9 Replies View Related

CONVERT DATETIME To VARCHAR With Code 106 Does Not Show Long Month

Oct 26, 2007

I am having a problem while converting datetime to varchar with code 106. Here is the code and result I get:

TSQL Code:
SELECT CONVERT(VARCHAR(100), GETDATE(), 106)

Result:
"26 10 2007"

My expected result:
"26 Oct 2007" or "26 October 2007"

Have you encountered this problem before? Is it related to the SQL server setting? Please help and thank you in advance.

View 6 Replies View Related

Code Page Question (convert Squiggles To Korean And Chinese, Store In Nvarchar)

Jan 17, 2008

Hi all,

I spent about an hour searching the forums and the web but could not find a solution. Bob Bojanic, if you are around can you answer?


I have a DB that stores WW data for company names in a varchar

I don't have control over this DB, other than to pull data from it

I have an SSIS package that grabs WW data in a single pull using a system account

I have an Execute SQL task that runs a sproc to stage the data

I have a Data Flow Task that then copies the data to another server (where I need it)

The destination columns are nvarchar. The source columns are varchar.
Some countries (such as Korea and China) end up with ASCII gibberish (because of code page issues).

I have a solution that involves pulling the data, BCP the pulled data to a text file, then re-import with the correct code page, and delete the gibberish. BUT, I'd like to do this as part of the pull if possible (without any data duplication).

I've tried modifying the CodePage properties for both the Staging step (Execute SQL task running a sproc) and the Source & Dest columns for the Data Flow Task with no luck. Can anyone assist? Thanks much!

Brian

View 9 Replies View Related

Convert Access To SQL

Jul 15, 2006

The following is my code for Access... can someone help me convert it to sql:
My Connectionstring is "server=(local);database=Database;trusted_connection=true"
 
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script language="VB" runat="server">
Sub btnLogin_OnClick(Src As Object, E As EventArgs)
Dim myConnection As OleDbConnection
Dim myCommand As OleDbCommand
Dim intUserCount As Integer
Dim strSQL As String
strSQL = "SELECT COUNT(*) FROM tblLoginInfo " _
& "WHERE username='" & Replace(txtUsername.Text, "'", "''") & "' " _
& "AND password='" & Replace(txtPassword.Text, "'", "''") & "';"
myConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " _
& "Data Source=" & Server.MapPath("login.mdb") & ";")
myCommand = New OleDbCommand(strSQL, myConnection)
myConnection.Open()
intUserCount = myCommand.ExecuteScalar()
myConnection.Close()
If intUserCount > 0 Then
lblInvalid.Text = ""
FormsAuthentication.SetAuthCookie(txtUsername.Text, True)
Response.Redirect("login_db-protected.aspx")
Else
lblInvalid.Text = "Sorry... try again..."
End If
End Sub
</script>

View 4 Replies View Related

Convert From Access DB To SQL DB....

Nov 4, 2007

Dear All,
 I would like to convert from Access To SQL DB undervisual Studio.Net 2005...
How can I do it easily, or if there any software to do this automaticlly, please your help..
 Awaiting your valuable reply.
Many thanks in advance for your cooperation and continuous support....

View 6 Replies View Related

DB Convert From Access

Feb 16, 2005

I am currently in the process of writing an application to convert an Access database to SQL. Basically, I have created an odbc link in access and then I transfer the data from the access table to the linked table.

The problem is where I have to transfer the Identity keys. I can transfer all the data but the keys. They will auto increment. I tried using INSERT_IDENTITY tablename ON but it just returns an error mosty of the time. I have gotten it to transfer once or twice by stepping through.

Here is the basic code:

The code that causes everything to error is commented out.


Private Sub CopySQLRecordSet(ByVal stTableName As String, _
Optional ByVal blIdentity As Boolean = True, _
Optional ByVal stSearch As String = "")
Dim cat As ADOX.Catalog
Dim tbl As ADOX.Table
Set cat = New ADOX.Catalog
Set tbl = New ADOX.Table
Dim adoCommand As New ADODB.Command, stCommand As String
Dim adoSQLCommand As New ADODB.Command
Dim errorString As String

On Error GoTo ErrorCopying
PrgPart.Value = PrgPart.Value + 1
If blCancelPressed Then End '???fix later
cat.ActiveConnection = db1 'This doesn't seem to work with our normal settings for spectrumDbase
tbl.ParentCatalog = cat
tbl.Name = "dbo_" & stTableName
tbl.Properties("Temporary Table") = False
'possibly, this line will work for Oracle as well
tbl.Properties("Jet OLEDB:Link Provider String") = "odbc;DSN=
;DATABASE=database;"
tbl.Properties("Jet OLEDB:Remote Table Name") = stTableName
tbl.Properties("Jet OLEDB:Create Link") = True
tbl.Properties("Jet OLEDB:Table Hidden In Access") = False
tbl.Properties("Jet OLEDB:Cache Link Name/Password") = False
cat.Tables.Append tbl
Suspend 1
adoCommand.CommandType = adCmdText
adoCommand.ActiveConnection = database
adoSQLCommand.CommandType = adCmdText
adoSQLCommand.ActiveConnection = rsDbase

'spectrumDBase.BeginTrans
'stCommand = "BEGIN TRANSACTION " & vbNewLine _
' & "go" & vbNewLine
'If there is an identity field in the table, it must be temporarily disabled
'to insert from an foreign DB.
'If blIdentity Then
' stCommand = stCommand & "SET IDENTITY_INSERT dbo_" & stTableName & " ON " & vbNewLine & "GO" & vbNewLine
'adoCommand.CommandText = stCommand
'adoCommand.Execute
'End If

'insert the records from the source table
stCommand = ""
stCommand = stCommand & "INSERT INTO dbo_" & stTableName _
& " SELECT * FROM " & stTableName & vbNewLine _
& "GO" & vbNewLine

'stCommand = stCommand & "COMMIT TRANSACTION"

adoCommand.CommandText = stCommand
adoCommand.Execute

'clean up
' stCommand = stCommand & vbNewLine & "DROP TABLE dbo_" & stTableName & vbNewLine & "GO"
' adoCommand.CommandText = stCommand
' adoCommand.Execute

'reinsert identity property
' If blIdentity Then stCommand = "SET IDENTITY_INSERT " & stTableName & " OFF" & vbNewLine

'Block statement, going to leave this out for now
'stCommand = stCommand & "go" & vbNewLine _
'& "COMMIT TRANSACTION"

'adoCommand.CommandText = stCommand
'adoCommand.Execute

Set adoCommand = Nothing
Set adoSQLCommand = Nothing
Exit Sub
ErrorCopying:
'need to save this to a string so it doesn't reset when Resume occurs
errorString = Err.Description
' MsgBox "Error copying the [" & stTableName & "] table." & vbNewLine _
' & "Error: " & errorstring
Resume errorCatch
errorCatch:
On Error Resume Next
'set a log
Dim fso As FileSystemObject, fStream As TextStream
Set fso = New FileSystemObject
Set fStream = fso.OpenTextFile(App.Path & "DBTransfer.log", ForAppending, True)
fStream.WriteLine "***Error copying the [" & stTableName & "] table."
fStream.WriteLine " Error: " & errorString
fStream.WriteLine " "
fStream.Close
Set fStream = Nothing
Set fso = Nothing
'clean up
adoCommand.CommandText = "DROP TABLE dbo_" & stTableName
adoCommand.Execute
If blIdentity Then
'reinsert identity property
adoSQLCommand.CommandText = "SET IDENTITY_INSERT " & stTableName & " OFF"
adoSQLCommand.Execute
End If
Set adoCommand = Nothing
Set adoSQLCommand = Nothing
End Sub

View 8 Replies View Related

Convert Access Dba To Ms Sql

Jan 24, 2008

Who convert access dba to ms sql 2000 standard.
I try with access conversion, but some buttons commands and rules don´t work.
The dba contains tabs, forms, rel´s, macros, modules and relations with tabs and examination images. It´s possible convert everything without damage or transform this itens?
The dba contains critical information about identification and personal clinic story about patients, but the access capacity it´s out (2GB) and i need to expand this dba.

I have some urgency to this problem, it´s depends to buy a windows 2008 server and mssql server 2008.

I hope everyone help me.

Thanks,

View 1 Replies View Related

Code Access

Mar 13, 2008

When a remote user tries to view my VIEW code using sp_helptext I want to deny permission.

Is there any way to achieve this in sql 2005?

View 4 Replies View Related

How To Convert A Database From MS Access To MS SQL

Feb 9, 2004

hi all,

How to convert a database from MS Access to MS SQL, is there some tool like that?

View 1 Replies View Related

Convert My ACCESS 2000 Db To MS SQL

Jul 31, 2007

I have an Access database and would like to convert it to an MS SQL database?!

View 4 Replies View Related

Convert Access Query To Sql

Aug 17, 2007

I am being asked to convert this access query into sql server 2000.
Access query
SELECT Left(Trim([Notes_Primary_Key]),InStr(Trim([Notes_Primary_Key])," ")) AS PcnPID, Trim([Notes_Secondary_Key]) AS PcnTicketNum
FROM tri_offnotes;

I'm new to SQL and am not familiar with which function replaces the InStr access function.

View 2 Replies View Related

Convert Access Queries To SQL

Oct 15, 2007

I have an Access database that used to produce a mass of Performance Indicators from Access tables. The data is now held on SQL Server and I run the Access queries from the SQL tables. I wouldlike to move all the queries over to SQL but not sure if I can do that. Here's an example of one of the queries (the SQL view)

SELECT tblCalls.*
FROM tblCalls
WHERE (((tblCalls.Call_date)>=[Forms]![ReportParams]![SDate] And (tblCalls.Call_date)<=[Forms]![ReportParams]![EDate]) AND ((tblCalls.NotAccepted)=False) AND ((tblCalls.Completed_time) Is Not Null) AND ((tblCalls.Category)="fly tipping"));


SELECT Month([Call_date]) AS Mnth, DateSerial(Year([Call_date]),Int((Month([Call_date])-1)/3)*3+4,0) AS Qtr, Sum(Work_Days([Call_date],[Completed_time])) AS RespTime, Sum(1) AS Count, Sum(Work_Days([Call_date],[Completed_time]))/[Count] AS AvgTime
FROM qryFlyTippingStatsSummary1
GROUP BY Month([Call_date]), DateSerial(Year([Call_date]),Int((Month([Call_date])-1)/3)*3+4,0)
ORDER BY Month([Call_date]), DateSerial(Year([Call_date]),Int((Month([Call_date])-1)/3)*3+4,0);

View 2 Replies View Related

Convert A Access Db To Sql 2005

Dec 16, 2007

what's the best way in sql 2005 to convert a access db?

View 1 Replies View Related

Convert From Access To SQL Server

Dec 28, 2006

Can I convert .MDB file to SQL Server database or I need to develop SQLserver database from begin, every table, every field?

View 2 Replies View Related

Convert Access Function To SQL

Jul 20, 2005

I'm going crazy trying to convert an Access Function to SQL.From what I've read, it has to be done as a stored procedure.I'm trying to take a field that is "minutes.seconds" and convert it to minutes.This is what I have in Access:Function ConvertToTime (myAnswer As Variant)Dim myMinutesmyMinutes-(((((myAnswer * 100)Mod 100/100/0.6)+(CInt(myAnswer-0.4))))ConvertToTime =(myMinutes)End FunctionWhen I tried to modify it in SQL:CREATE PROCEDURE [OWNER].[PROCEDURE NAME] AS ConvertToTimeFunction ConvertToTime(myAnswer As Variant)Dim myMinutesmyMinutes = (((((myAnswer * 100)Mod 100)/100/0.6)+9CInt(myAnswer-0.4))))ConvertToTime=(myMinutes)EndI get an error after ConverToTime.

View 2 Replies View Related

Convert An Access Db To SQLexpress

Oct 18, 2006

Hello to everybody,

I had just installed SQLserver Express. I'd like to know if tool to migrate an Access db to SQLexpress exists



Thank you

View 6 Replies View Related

Trying To Convert Query From T-SQL To Access

May 9, 2008

First off, I apologise if this is classed as off topic as it's concerning access but I couldn't see another forum that was better suited for this question.

I'm trying to run this query in Access. I designed it in SQL Management Studio with a test database that I set up and it runs fine. However, when I tried to run it in access I get a syntax error on the subquery bit. Can anyone tell me what I'm doing wrong here?

UPDATE tblInvoice
SET tblInvoice.PeriodID =
(SELECT p.PeriodID FROM tblPeriod p
INNER JOIN
tblInvoice i
ON i.TransDate BETWEEN p.PeriodStartDate AND p.PeriodEndDate
WHERE i.InvoiceID = tblInvoice.InvoiceID)

Thanks in advance,

Andy.

View 3 Replies View Related

Convert Access Query To Sql

Apr 10, 2007

how to convert this access query to sql query



IIf([Total Bunches] > 0, Production * 1000 / [Total Bunches], 0) as Name2

SUM(IIf(BlockInYield = -1, [SIZE], 0)) as Name1

IIf(BlockInYield = TRUE, IIf(TC_M > 0, TC_M, TC_DENS *[SIZE]), 0) as Name



please......

View 3 Replies View Related

How To Convert .btr File In SQL OR ACCESS

Apr 28, 2008

how To Convert .btr file in SQL OR ACCESS
please help me
tanks

View 4 Replies View Related

What Custom Code Can Access

Jun 8, 2007

I am trying to find ways around the limitation of not being able to resize columns based on the text input. I am dynamically setting what values a column is getting from my query. I am wondering if I can access the table (and thus, the columns) from within the custom code.

For example:

Public Function Whynot() As Integer
Report.table1.TableColumn1.Width = ....
table1.TableColumn.Width = ....
Return 0
End Function

Neither of these seem to work, anyone else have any ideas?

Thanks

View 2 Replies View Related

Code View Access

May 7, 2007

Hello all, I need to prevent all users (other than sysadmin/dbo) privs to access the database code (SP/Views/UDF). What would be the best way to achieve that? TIA

View 5 Replies View Related

Convert SQL Express To SQL Server Or Access

Dec 15, 2006

Is there anyway to convert an SQL Express database to SQL server or Access format?

View 1 Replies View Related

How Do I Convert A Sql Server Database To Access

Oct 3, 2007

I have a sql server database and i need to convert to Access, how can i do this using sql server? 

View 4 Replies View Related

Convert Access Into SQL Server Express

Dec 7, 2007

Sorry if this has been answered before. Could not find any answers.
OS Vista Business, SQL Server 2005 Express.
I have a CSV file which I imported to Access only 100 records with 8 fields. Then ran Tools >> Database Utilities >> Upsizing Wisard. The result was I exported the table field headers but not the data. Is there any method on how I can get the field headers and data into SQL Server Express? 

View 2 Replies View Related

Convert Update From Access To Sql And Have An Error.

Apr 7, 2004

I am trying to convert code I have working for access to work with SQL.
fldName, fldEmail, ID are the names in the database. recNum does have the value of the record that I want to edit. Here is the error I am getting.
System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near '?'.
And here is the stack trace (which I don’t know how to read except for the line the error is on)
[SqlException: Line 1: Incorrect syntax near '?'.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +723
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +194
goodellweb.adm_contact.editNow_Click(Object sender, EventArgs e) in C:Inetpubwwwrootwebrootgoodellwebadmadm_contacts.aspx.vb:306
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1315
here is my code.

Dim editSQL As String = "Update tbEmail Set fldName=?, fldEmail=? Where ID=?"
Dim SqlConn As New SqlConnection(ConnStr)
Dim Cmd As New SqlCommand(editSQL, SqlConn)
Cmd.Parameters.Add(New SqlParameter("@fldName", nameEdit.Text))
Cmd.Parameters.Add(New SqlParameter("@fldEmail", emailEdit.Text))
Cmd.Parameters.Add(New SqlParameter("@recNum", recNum))

SqlConn.Open()
Try
Cmd.ExecuteNonQuery()
Finally
SqlConn.Close()
End Try
Response.Write("recNum " & recNum & " <br>")
Thanks
Michael

View 4 Replies View Related

How To Convert Access Database To SQL (Urgent)

Dec 8, 1999

Hello sir,

I send you this message to told hwo can i do to convert one database which is in Access97 to SQL Server6.5.
I must create a interface in the web which is able to interrogate the database that the reason why i want to do that.
Thanks for any help in advance.

View 2 Replies View Related







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