Please I need some support to Translate
CREATE FUNCTION [dbo].[BDGetDataNasteriiFromCNP]
(
@CNP nvarchar(255)
)
RETURNS datetime
AS
BEGIN
DECLARE @returnVal datetime
DECLARE @Sex int
DECLARE @An varchar(10)
DECLARE @Luna varchar(10)
DECLARE @Zi varchar(10)
select @Sex = substring(@CNP, 1, 1),
@An = substring(@CNP, 2, 2),
@Luna = substring(@CNP, 4, 2),
@Zi = substring(@CNP, 6, 2)
if @Sex in (1,2,7)
begin
set @An = ’19’+ @An
end
else
begin
set @An = ’20’+@An
end
select @returnVal = convert(datetime, @An+@Luna+@Zi, 112)
RETURN @returnVal
END[/color][/color]
Default query begins like:
SELECT `Program_Operator`.`CNP` FROM `Program_Operator`
WHERE `Program_Operator`.`ID`='%ID%'
Extract age from CNP
Re: Extract age from CNP
Hi,
please use the "code" tag to show code - make it easier to read.
What do you need help with?
Is this a MSSQL Server Statement (of MySQL)?
What is your problem?
What is your goal (what are you trying to accomplish)? Do you want to read some date?
Your question is unclear (too unclear to me at least to give another answer).
Olaf
please use the "code" tag to show code - make it easier to read.
What do you need help with?
Is this a MSSQL Server Statement (of MySQL)?
What is your problem?
What is your goal (what are you trying to accomplish)? Do you want to read some date?
Your question is unclear (too unclear to me at least to give another answer).
Olaf
Some postings I was involved, you might find useful:
Multi Path Upload (MPU) / dynamic upload folder; SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button
Multi Path Upload (MPU) / dynamic upload folder; SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button