如何在Sql server 2008R2中搜索日期时间(How to Search datetime in Sql server 2008R2)
我有一个SQL搜索的问题。 我想在datetime的帮助下搜索,因为在我的项目中,时间非常重要。 当我使用这样的查询
where registration_date = '2014-06-19 00:12:08.940'
它确实有效,但一旦我尝试搜索使用
where registration_date like '2014-06-19%'
我没有结果。 因为我想搜索在特定日期(包括时间)发生的所有注册,我假设我不知道具体时间...
i am having problem with a sql search . i am trying to search with the help of datetime because in my project time is very important. when i use query like this
where registration_date = '2014-06-19 00:12:08.940'
it does works but as soon as i try to search using
where registration_date like '2014-06-19%'
i get no results. because i want to search for all the registration taken place on a specific date including time, i am assuming that i dont know the specific time...
原文:https://stackoverflow.com/questions/24383456
最满意答案
我使用for循环尝试了这一点。 检查这个简单的例子是否适合你。 接受了这篇文章的命令。
RM = rm -f FLAGS = -Cr -O1 -gv -gw -g -vw builddir = ./build/ TD = ./tasks/ SHELL := /bin/bash targets=$(shell for file in `find . -name '*.pas' -type f -printf "%f\n" | sed 's/\..*/\.out/'`; do echo "$$file "; done;) all: $(targets) %.out:%.pas fpc $< $(FLAGS) -o (builddir)$@ clean: $(RM) $(builddir)*
I tried this out using a for loop. Check if this simple example works for you. Took the command from this post.
RM = rm -f FLAGS = -Cr -O1 -gv -gw -g -vw builddir = ./build/ TD = ./tasks/ SHELL := /bin/bash targets=$(shell for file in `find . -name '*.pas' -type f -printf "%f\n" | sed 's/\..*/\.out/'`; do echo "$$file "; done;) all: $(targets) %.out:%.pas fpc $< $(FLAGS) -o (builddir)$@ clean: $(RM) $(builddir)*
相关问答
更多-
在GNU中列出目标/目标使得它们在定义中包含变量(List goals/targets in GNU make that contain variables in their definition)[2022-02-23]
你可以解析make -pn的输出(即make --print-data-base --dry-run )吗? 它打印出所有变量,规则,隐式规则以及哪些命令将在费力的细节上运行。 Can you parse the output from make -pn (i.e. make --print-data-base --dry-run)? It prints out all the variables, rules, implicit rules and which commands will be run i ... -
GNU Make中的仅订单目标 - 适用于Microsoft NMAKE?(Order-only targets as in GNU Make - for Microsoft NMAKE?)[2023-07-28]
不幸的是,微软NMAKE没有像GNU make这样只有订单的先决条件,并且考虑到他们已经很久以后转向其他构建工具,比如MSBuild,微软不太可能会添加这样的功能。 但是, ElectricAccelerator是一款高性能GNU make和NMAKE替代品,它支持NMAKE模式下的仅订购先决条件。 你可以尝试一下。 (免责声明:我是ElectricAccelerator的架构师和首席开发人员) Unfortunately no, Microsoft NMAKE does not have anything ... -
看看递归make 。 你可以做类似的事情, SRCDIR := src TARGETS := projA projB .PHONY: $(TARGETS) $(TARGETS): cd $(SRCDIR)/$@; $(MAKE) release Have a look at recursive make. You could do something like, SRCDIR := src TARGETS := projA projB .PHONY: $(TARGETS) $(TARGETS) ...
-
GNU make:来自文件内容的动态目标,文件本身就是目标(GNU make: dynamic targets from the content of a file which itself is a target)[2022-06-07]
如果some_command生成一个以空格分隔的目标文件名列表,这将起作用。 (如果格式是其他的,我们可以解决它。) include target.list all: $(targets) $(targets): %.o: %.c target.list: some_command | sed 's/^/targets:=/' > $@ 当Make看到它必须include target.list ,并且存在重建该文件的规则时,它将尝试这样做然后重新开始。 并且target.list的规则将“ ... -
我使用for循环尝试了这一点。 检查这个简单的例子是否适合你。 接受了这篇文章的命令。 RM = rm -f FLAGS = -Cr -O1 -gv -gw -g -vw builddir = ./build/ TD = ./tasks/ SHELL := /bin/bash targets=$(shell for file in `find . -name '*.pas' -type f -printf "%f\n" | sed 's/\..*/\.out/'`; do echo "$$file "; ...
-
所以我把它复制到我的机器上并设法重现你的问题和解决方案。 请注意,在.INTERMEDIATE目标中,您使用$(OBJECT_FILES)作为先决条件,但对于生成.o文件的规则,您使用模式规则。 这会让人感到困惑,并且它无法识别两者都指的是同一件事。 这个问题有两种解决方案: 将.INTERMEDIATE的先决条件从$(OBJECT_FILES)更改为%.o ,所以它看起来像 .INTERMEDIATE: %.o 更改制作.o文件的规则 $(OBJECT_FILES): $(SOURCE_FILES) ...
-
我找到了解决方案。 来自文件/usr/share/bash-completion/completions/make的函数_make_target_extract_script中的错误,它返回sed -script,其中包含行: /^[^a-zA-Z0-9]/ d # convention for hidden tgt 删除以非拉丁字符开头(特别是)的目标。 在我看来,这样的正则表达式会更合适(见本文 ): /^[^[[:alnum:]]]/ ...
-
如果你只想为你的构建计时,并且你在UNIXy平台上运行,为什么不只是使用time呢? 如: pax$ time sleep 1 real 0m1.004s user 0m0.000s sys 0m0.000s (虽然,在你的情况下,它当然是time gmake all )。 这似乎是一个更优雅的解决方案,而不是尝试在make编写代码并使用正确的工具来完成工作。 或者,您可以将规则本身修改为: all: T1 T2 ... TN @perl -e blah ...
-
如何强制某些目标组与GNU Make并行运行?(How to force certain groups of targets to run in parallel with GNU Make?)[2023-05-29]
使并行性并行化作为先决条件找到的目标。 它不会并行化目标配方中的行。 这些总是按顺序一次执行一次。 如果你想并行化这两个make命令,那么你需要使用更像的东西 myParallelTarget: target1 target2 但是如果在使用-j参数运行make时遇到myParallelTarget (无论是在命令行上还是作为另一个目标的先决条件),那些将并行运行。 相反,阻止目标并行运行意味着手动运行它们或通过先决条件链对它们进行显式排序。 make parallelism parallelizes t ... -
这里的FWIW是make等效语法 .for _target in configure build test install .if !target(${_target}) ${_target}: pre-${_target} ${_target}: do-${_target} ${_target}: post-${_target} .endif .endfor 基本上,你想让make看到这样的代码片段: build: pre-build build: do-build build: post-build ...