I tried to create a query below. It's weird that when i copied the table with left few records in there, it's worked and showed corrected results. However, when i switched back to the original table with thousands, thousands records in there, and it's not working. It's showing single record in...
Thanks again LaurieHamlin.
I tried to grouped by all fields but didn't work.
I'm trying to see if i can use UNION query as a sub query but couldn't find a solution yet.
TN
Thanks LaurieHamlin for your time.
If i try to group by, it's only worked on the first 2 parts
For each tableA.STREET, If LOW_Right > 0 and there are multiple rows of tableA.STREET and LOW_Right that have the same value, only the row that has the highest UP_Right value should be shown
For each...
Hello,
I created an access query with union. Everything is working fine now. But i would like to eliminate the duplicate records if more than one have the same Full street address.
Here is my query:
SELECT tableA.LOW_Right as From, tableA.UP_Right AS To, 1 AS Status, tableA.STREET AS...
Please help. I have SQL server 2000 and trying to migrate to either 2008 R2 or 2012. However, I have tons of databases in SQL Server 2000.
Is there any sample script that i can use to find out the last accessed date of the SQL Server databases?
I need to know if the databases are in use or if...
gmmastros, thank you so much for your help. I'm so appreciated.
I'm about to say that the first code is showing all patients with P status when testing.
I tested your second script and everything worked so fine. It showed all M patients with no P patients in the next 30 days booked.
Again...
Thanks all the the quick respond.
gmmastros, yes that's exactly what i'm looking for. however i need to join with other tables as well.
Again, thank you so much
I'm using SQL 2008 R2, i have a query
SELECT Mpfile.PATIENT_NO AS [Patient No.], Padfile.CLINIC AS Clinic, Tbclinic.DESCRIPTION AS ClinicDesc, Padfile.APPT_DATE, Padfile.TYPE AS Type,
Padfile.DISPOSITION AS Status
FROM dbo.MPFILE AS Mpfile INNER JOIN...
Thanks everyonẹ That's what i thought. No luck, there's no date stored. I'll try to search and see if any of those related tables so I can get the date from there.
Again, thank you so much.
I'm using SQL server 2008 R2. I have an "Employee" table with no date time stamp column. I would like to track down the initial date time stamp when each employee has been inserted into table. I know that if i add a new column with Getdate() function, this date is just apply for new record only...
I'm using SQL 2008 R2. I'm trying to update the MAX record from another table to the view but got error.
Error "Msg 4406, Level 16, State 1, Line 1
Update or insert of view or function 'dbo.V_Notes_1' failed because it contains a derived or constant field."
My code:
UPDATE dbo.V_Notes_1
SET...
Thank you so much DaveInIowa and gmmastros
I tried LAG funciton but mine is still 2008 R2 server, and got error because it's not recognized the function.
I used gmmastros code on a simple query, it worked but took so long to get the result.
With Data As
(
Select PATIENT_NO, IMM_DATE...
Let me explain this,
the query result:
ID VisitDate
125 1/1/2012
125 8/25/2012
125 1/8/2013
257 6/7/2012
257 9/15/2012
257 3/15/2013
257 6/1/2013
Now i would like to create another new column call "Previous Date" and pull data from VisitDate such as:
ID...
I got it worked, all i needed is OperatorID only
i changed these on function and code:
Public Function ResendPaymentEmailAddress(strOperatorID As Integer) As String
,....
....
rst.Source = "EXEC sp_ResendPayEmail " & strOperatorID
from my code changed to this:
strResendEmail =...
thanks dhookom for your advice. However, sorry for the confusion.
my module name "modSendEmail" and function named "ResendPaymentEmailAddress"
Public Function ResendPaymentEmailAddress(strOperatorID As Integer, strOperatorName As String, strOperatorEmail As String) As String
i tested with no...
OK here's what i did,
i added the Microsoft ActiveXData Objects 2.5 as you said
i create a module named "ResendPaymentEmailAddress"
Option Compare Database
Option Explicit
Public rst As ADODB.Recordset
Public con As ADODB.Connection
Public strCon As String
Public strOperatorID As Integer...
i tried to use this but got error when i clicked on the button
error : complile error:
User-definied type not defined
Private Sub cmdSendEmail_Click()
On Error GoTo Err_cmdSendEmail_Click
Dim conn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim strConn As String...
This is the stored procedure:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_ResendPayEmail]
(
@id int
)
AS
DECLARE @operatorname AS nvarchar(100),
@operatoremail AS nvarchar(100),
@title AS nvarchar(100),
@message AS nvarchar(max),
@webpermitid AS int
--CHECK...
Hello,
I tried to run the update state but i got errors and couldn't figure out what's wrong, please help.
Thanks in advance.
TN
Here's my code:
--Update Title X - addnote field
update ENHFILE
set e.X12_ADD_NOTE = (
select distinct
case when RACE = 'A' then '5'
when RACE = 'B' then...
Hello,
I tried to run the update state but i got errors and couldn't figure out what's wrong, please help.
Thanks in advance.
TN
Here's my code:
--Update Title X - addnote field
update ENHFILE
set e.X12_ADD_NOTE = (
select distinct
case when RACE = 'A' then '5'
when RACE = 'B' then '2'
when...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.