用什么开发呀?
什么数据库?********************************************
http://www.itpub.net 最专业的oracle讨论站点
什么数据库?********************************************
http://www.itpub.net 最专业的oracle讨论站点
解决方案 »
- Delphi调用C# Webservice,有关Session问题
- 一篇博文,敬请关注一次,谢谢
- 三层结构中:服务器(中间层)如何通知 所有客户端发生了什么事件,要求处理什么事了
- 急求:fastrepor的主项头、主项数据怎么用显示出表格线???
- 程序打包发布时如何在安装完毕后自动将SQL SERVER数据库导入。(200分)
- 高手求救 !!!!
- 請問怎樣改變一下我的Dcom中的Port值?
- sql server2000的序列号是多少呀 ?
- 呼叫‘考勤王’!!哪位GG或MM知道指纹的采样方法呀???
- 如何通过编绎开关区分系统安的office的版本?
- 大家好呀,,,我有个地方不明白,也是刚发现的,关于query的sql?
- API函数的引用问题
var 日期变量:date
var 日序号:integer
begin
日期变量:=3000。1。1
日序号:=0
打开表
按日期索引
到头
WHILE 没有到尾
IF 表.日期=日期变量 THEN BEGIN
日期变量:=表.日期
日序号:=0
END
替换结果子断 WITH 字符串(日期变量)+数字字符串(日序号)
日序号+1
表移到下一个纪录
END
显示:"都做完了!"
END
你将它放到一个存储过程中调试一下应该可以!declare @i int,@j int,@Name varchar(10),@time Datetime,@tmptime Datetime,@tmp varchar(11)
set @i=1
set @tmptime=getdate()+1
declare xxx cursor for Select name,time from table1 order by time
open xxx
T_NEXT_NEW:
fetch xxx into @name,@time
if (@@fetch_status=0)
begin
if convert(char(8),@time,112)<>convert(char(8),@tmptime,112)
begin
set @tmptime=@time
set @i=1
end
set @tmp=convert(char(8),@time,112)
set @tmp=@tmp+'00'
set @i=convert(int,@tmp)+@i
select @name,@time, convert(char(11),@i) as '编号'
goto T_NEXT_NEW
end
close xxx
deallocate xxx
function strnum(x:integer,l:integer):string
var i:integer;s:string;
begin
s:=inttostr(x);
i:=length(s);
result:=s+copy('0000000000000000',1,3-i)
end
改为
result:=copy('0000000000000000',1,3-i)+s
mMinValue, mMaxValue: Integer; mChange: Boolean): Integer;
var
I: Integer;
begin
with TStringList.Create do try
try
if FileExists(mFileName) then LoadFromFile(mFileName);
I := StrToIntDef(Values[mFieldName], 0);
if (mMaxValue <> 0) and (I > mMaxValue) then I := mMinValue;
if mChange then begin
Values[mFieldName] := IntToStr(I + 1);
SaveToFile(mFileName);
end;
Result := I;
except
Result := -1;
end;
finally
Free;
end;
end; { FileIndex }//demo
DateToStr(Date) + FloatFormat('000', FileIndex('Index.txt', DateToStr(Date), 1, 999, True));
以下是一个思路没有编译过,
你将它放到一个存储过程中调试一下应该可以!declare @i int,@j int,@Name varchar(10),@time Datetime,@tmptime Datetime,@tmp varchar(11)
set @i=1
set @tmptime=getdate()+1
declare xxx cursor for Select name,time from table1 order by time
open xxx
T_NEXT_NEW:
fetch xxx into @name,@time
if (@@fetch_status=0)
begin
if convert(char(8),@time,112)<>convert(char(8),@tmptime,112)
begin
set @tmptime=@time
set @i=1
end
set @tmp=convert(char(8),@time,112)
set @tmp=@tmp+'00'
set @j=convert(int,@tmp)+@i
select @name,@time, convert(char(11),@j) as '编号'
set @i=@i+1
goto T_NEXT_NEW
end
close xxx
deallocate xxx
其实一两条语句就可以搞定了。
假设time是datetime 型,且精确到时分秒(可能会有重复):
select identity(int,1,1) as id,convert(varchar,ftime,101) as ftime,fname
into #temp from tablename order by ftimeselect f1+replicate('0',3-len(cast(f2 as varchar)))+cast(f2 as varchar) fno
,fname
from (
select right(ftime,4)+left(ftime,2)+
substring(ftime,4,2) f1,
id +1-
(
select min(id) from #temp t1
where t1.ftime=t2.ftime) f2,fname from #temp t2
) t3
order by f1,f2若time字段没有重复,就只一条语句就可以搞定了,写法可以自己想想:)